Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding A Record Using Multiple Criteria

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a table that has a multiple-field index that uniquely identifies each record.

I have a form that has a combo box which is supposed to allow the user to select an item. Currently, the combo box has two columns which have enough information to uniquely select a record from the table.

I would like to be able to have it so that when an item is selected, the rest of the fields in the form will update according to the selected record.

I don't think it's possible for a macro to have two criteria in a FindRecord action since it can only access the bound column in a combo box, so I have been trying to do it with a module, since in a module I can use combobox.column(0) and combobox.column(1) to get the two values necessary to find the record.

So, is there a way to do a DoCmd.FindRecord with two criteria? If not, do you have any suggestions? I think that autonumbering would also do the job, but I would prefer not to use autonumbering.

Thanks for any help.

Vincent Cheung
Vincent.Cheung@mts.mb.ca
 
If I understand you correctly, you want to be able to choose something in a combo box, and allow that to populate other fields on the same form based on the combo box selection. If this is the case read on..

What you want is called Auto Lookup I believe. Anyway, this is how it works. You write a query that pulls records from two tables; (1) the one that has the information that goes in the combo box and (2) the one that you want to input the data into. If you use the query grid, pull down the index field from table (2) and all the other fields that you want to populate on the form from table (1). Then, bind your form to the query, you may have to re-establish the links from the query to the appropriate field in the form. Now, when you choose an item from the combo box, the query should automatically fill in the other fields.

I hope this helps:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top