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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching tables with indices 2

Status
Not open for further replies.

Ryker7

MIS
Jun 19, 2003
44
US
I have a three table query...the last table being the vendor table. On the form, I need to key in a vendor number and automatically populate the name and address field from the vendor table. I have made this work, however I need to do this 5 different times on the form....different vendors on the same form....and I cannnot since the record only has one vendor name and address field. But, I have set up 5 different payee fields and addresses. Is there a way to just search the vendor table for the matching vendor number and populate with the corresponding information?
 
I am not sure I understand your point, but have you tried DLookUp?
DLookup Function Examples
faq705-4978

 
If I understand right, it sounds to me like your database is not normalized. Explain your two other tables. But it sounds like you have either a one to many or likely a many to many relationship.
"I need to do this 5 different times on the form....different vendors on the same form....and I cannnot since the record only has one vendor name and address field."

My guess is that you need a many to many. For example maybe one of the tables is "Products", and a given product has 5 different vendors. But, several products share the same vendors. What you then need is a join table.

joinTblProducts_Vendors
lngProductID
lngVendorID

If I guessed wrong about this, explain more about what the "five times on a form" is doing.
If I am right, and you want to assign multiple vendors to something (product maybe) you will likely use a sub form that incorporates this join table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top