Prompt user for "like"

K

Kate

I have a database that is linked to an ODBC (which is our production system).
I have created a database that allows the user to update the pricing of our
material.

After changes have been made, a macro sends the user a report that shows the
updated pricing.

Here's what I can't figure out: The user needs to be able to, when sending
the report, enter a number to search by to limit the results of the query.
For example, they will need to search by the P.O. number which is in the
format of: W050642K, where W = plant name code, 0506 format of date, and 42K
is the board grade.

When the query runs, I need it to prompt the user to enter the "0506"
information (that will be different for every month, June = 0606, etc.).

How can you prompt the user to only have to enter the 4 digit month/year
combo and have it search the P.O. field for P.O.'s that include the 4 digit
combo?

I can hard-code it in the design view and it works fine, but I want it to
prompt the user to enter the 4 digit combo....any suggestions?
 
J

John Spencer

Use criteria like the following

Criteria: LIKE "?" & [Enter Year and Month] & "*"

That should find records that start with one character followed by whatever
is entered in response to the prompt and with zero to many other characters
after that.
 
T

Traci

John,

I'm curious if this criteria will work for the following? I tried it in my
world but it did not perform like I understood it would.

I've got a simple knowledge base that I'm creating where I've provided a
column called "Keywords" that I want the user to enter some partial set of
characters and return any record that contains that string. For example, the
contents in one row are as follows: "MSHP DSC Provisioning". I would like
to prompt the user to enter a keyword, in this example, DSC, and return all
records where the string DSC is found in the keyword column.

Any assistance would be much appreciated!


John Spencer said:
Use criteria like the following

Criteria: LIKE "?" & [Enter Year and Month] & "*"

That should find records that start with one character followed by whatever
is entered in response to the prompt and with zero to many other characters
after that.

Kate said:
I have a database that is linked to an ODBC (which is our production
system).
I have created a database that allows the user to update the pricing of
our
material.

After changes have been made, a macro sends the user a report that shows
the
updated pricing.

Here's what I can't figure out: The user needs to be able to, when
sending
the report, enter a number to search by to limit the results of the query.
For example, they will need to search by the P.O. number which is in the
format of: W050642K, where W = plant name code, 0506 format of date, and
42K
is the board grade.

When the query runs, I need it to prompt the user to enter the "0506"
information (that will be different for every month, June = 0606, etc.).

How can you prompt the user to only have to enter the 4 digit month/year
combo and have it search the P.O. field for P.O.'s that include the 4
digit
combo?

I can hard-code it in the design view and it works fine, but I want it to
prompt the user to enter the 4 digit combo....any suggestions?
 
J

John Spencer

to find a string anywhere in the field you would use criteria like the
following.

Like "*" & [What do you want now?] & "*"

Look up wildcards in the help. In some cases the wild cards would be "%"
instead of "*"



Traci said:
John,

I'm curious if this criteria will work for the following? I tried it in
my
world but it did not perform like I understood it would.

I've got a simple knowledge base that I'm creating where I've provided a
column called "Keywords" that I want the user to enter some partial set of
characters and return any record that contains that string. For example,
the
contents in one row are as follows: "MSHP DSC Provisioning". I would
like
to prompt the user to enter a keyword, in this example, DSC, and return
all
records where the string DSC is found in the keyword column.

Any assistance would be much appreciated!


John Spencer said:
Use criteria like the following

Criteria: LIKE "?" & [Enter Year and Month] & "*"

That should find records that start with one character followed by
whatever
is entered in response to the prompt and with zero to many other
characters
after that.

Kate said:
I have a database that is linked to an ODBC (which is our production
system).
I have created a database that allows the user to update the pricing of
our
material.

After changes have been made, a macro sends the user a report that
shows
the
updated pricing.

Here's what I can't figure out: The user needs to be able to, when
sending
the report, enter a number to search by to limit the results of the
query.
For example, they will need to search by the P.O. number which is in
the
format of: W050642K, where W = plant name code, 0506 format of date,
and
42K
is the board grade.

When the query runs, I need it to prompt the user to enter the "0506"
information (that will be different for every month, June = 0606,
etc.).

How can you prompt the user to only have to enter the 4 digit
month/year
combo and have it search the P.O. field for P.O.'s that include the 4
digit
combo?

I can hard-code it in the design view and it works fine, but I want it
to
prompt the user to enter the 4 digit combo....any suggestions?
 
L

LarryP

John hasn't had time to reply yet, but I have a spare moment, and I would
think something like

Like "*" & [stuffyou'relookingfor?] & "*"

would do it for you.

Traci said:
John,

I'm curious if this criteria will work for the following? I tried it in my
world but it did not perform like I understood it would.

I've got a simple knowledge base that I'm creating where I've provided a
column called "Keywords" that I want the user to enter some partial set of
characters and return any record that contains that string. For example, the
contents in one row are as follows: "MSHP DSC Provisioning". I would like
to prompt the user to enter a keyword, in this example, DSC, and return all
records where the string DSC is found in the keyword column.

Any assistance would be much appreciated!


John Spencer said:
Use criteria like the following

Criteria: LIKE "?" & [Enter Year and Month] & "*"

That should find records that start with one character followed by whatever
is entered in response to the prompt and with zero to many other characters
after that.

Kate said:
I have a database that is linked to an ODBC (which is our production
system).
I have created a database that allows the user to update the pricing of
our
material.

After changes have been made, a macro sends the user a report that shows
the
updated pricing.

Here's what I can't figure out: The user needs to be able to, when
sending
the report, enter a number to search by to limit the results of the query.
For example, they will need to search by the P.O. number which is in the
format of: W050642K, where W = plant name code, 0506 format of date, and
42K
is the board grade.

When the query runs, I need it to prompt the user to enter the "0506"
information (that will be different for every month, June = 0606, etc.).

How can you prompt the user to only have to enter the 4 digit month/year
combo and have it search the P.O. field for P.O.'s that include the 4
digit
combo?

I can hard-code it in the design view and it works fine, but I want it to
prompt the user to enter the 4 digit combo....any suggestions?
 
Top