How do I use a query to populate a 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
 
G

Guest

Hi Mike,

Have the form record source set to the query, and have your fields on your
form bound to the appropriate fields in your query. Have an unbound text box
at the start of your form, and have an after update event that fires like
this:

me.recordsetclone.findfirst("[PartNumber]=" & me.numPartNumber)
me.recordset.bookmark = me.recordsetclone.bookmark

Note that this example assumes PartNumber is a numeric field. Use single
quotes to delimit the Part Number if it's a text field.

Hope this helps.

Damian.
 

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