Query Search

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a parts inventory database. In the database I have a query that
searches by part description. When I run the query a window pop ups and
requests to input a part description. If I put in the complete and exact name
of the part, I get the total number of that particular part in the table.
What I want to be able to do is input part of the actual description name in
the pop up window instead of the complete name and get the same results. In
other words if I'm searching for a modem, I want to be able to input modem or
mod and get the same results. I guess something like a wild search.

This is my SQL:
SELECT tblSiteInventory.ID, tblSiteInventory.Region, tblSiteInventory.State,
tblSiteInventory.Site, tblSiteInventory.PartDescription,
tblSiteInventory.PartNumber, tblSiteInventory.[Total On Hand],
tblSiteInventory.[Total Repair], tblSiteInventory.Date, tblSiteInventory.Tech
FROM tblSiteInventory
WHERE (((tblSiteInventory.PartDescription)=[Input Part Description]));

Thanks for the help,
V3M (not an expert in Access)
 
Hi,

In your where statement, change the equal sign to like. Then when you enter
the part name you can enter partial names along with wildcard characters (*)
for the parameter. In your example you could then enter 'modem' or 'mod*' to
get the same results.

Note that when doing this that 'mod' (no *) will only return a part with the
complete name of 'mod'. You need the * in order to use a partial name.

Jim
 
Jim,

Thanks for your help. That worked.

Vic

Jim C. said:
Hi,

In your where statement, change the equal sign to like. Then when you enter
the part name you can enter partial names along with wildcard characters (*)
for the parameter. In your example you could then enter 'modem' or 'mod*' to
get the same results.

Note that when doing this that 'mod' (no *) will only return a part with the
complete name of 'mod'. You need the * in order to use a partial name.

Jim

V3M said:
I have a parts inventory database. In the database I have a query that
searches by part description. When I run the query a window pop ups and
requests to input a part description. If I put in the complete and exact name
of the part, I get the total number of that particular part in the table.
What I want to be able to do is input part of the actual description name in
the pop up window instead of the complete name and get the same results. In
other words if I'm searching for a modem, I want to be able to input modem or
mod and get the same results. I guess something like a wild search.

This is my SQL:
SELECT tblSiteInventory.ID, tblSiteInventory.Region, tblSiteInventory.State,
tblSiteInventory.Site, tblSiteInventory.PartDescription,
tblSiteInventory.PartNumber, tblSiteInventory.[Total On Hand],
tblSiteInventory.[Total Repair], tblSiteInventory.Date, tblSiteInventory.Tech
FROM tblSiteInventory
WHERE (((tblSiteInventory.PartDescription)=[Input Part Description]));

Thanks for the help,
V3M (not an expert in Access)
 
Back
Top