Lookup multiple values from a user input??

S

Steve

I want to be able to pull data from different fields on the same table based
on a user input.

My database is for tooling we use in our machines. I want the user to be
able to enter the tool number and see a list of the programs the tool is used
on. I had a query that would do this, but it would only look in whichever
table field I linked it to. It won't do it if I link to more than one field.

Thanks
 
G

Golfinray

As a rule, you would want to 1. Make sure all your tables are editable (they
have an arrow and asterisk at the bottom. 2. If they are editable then go
into tools\relationships and establish relationships between the tables. Each
table should have a primary key that allows them to "hook up" and relate to
each other. If they don't have primary keys you could assign those. Use
something that is common between the tables like an ID or you can create your
own ID filed. 3. Build the query with the now-hooked up tables. Make sure it
is editable. 4. Now build a form with a filter so users can select from all
the info available. The standard way to create a filter is:
Add a combo box to your form
let the combo wizard select the field you would like to search on (like id)
right click on the combo and select properties
go into events and click on afterupdate. Start the code builder and type:
Me.Filter = "[your id field] = """ & Me.Combo# & """"
Me.filteron = true

Combo# will be the number of the combo like combo10 or combo 49
 

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