Using a query to populate a search form

G

Guest

I have a query that i want to use to look up parts by part number, every
part has 20 related field in this query, i want to use a textbox to type
the part number and use a command button to execute the search that will then
populate the remaining fields, how should this be done
 
J

Jeff Boyce

Use a form.

Add a combo box that lists all parts.

Bind the form to a query that returns the part-related fields, but only for
the part selected in the combo box.

In the AfterUpdate event of the combo box, requery the form:
Me.Requery

Now you have a form that lets the user select a part and see the
part-related field values.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Thanks Jeff, the part numbers either start with a number or a such as 1,2,3,
etc... or they start with a "#" then numbers or letters, will this still work?
 
J

Jeff Boyce

You can use whatever you want as the row source in a combo box...

What happens when you try it?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top