search to 'pull' data from diff table?

snowman

Registered User.
Local time
Today, 19:19
Joined
Mar 3, 2006
Messages
24
v sorry for the basic question, but ive been banging away at access and i cant my head around this..

i need to run a simple query. the query/ search will ask users to enter in the number of a document. i want, when this code is entered, for 2 controls on the form be updated with codes that are stored in a table based on the code they searched for originally.

heres my table structure...
Table A
Doc ID (PK)
Doc No (manually input and is the search item that users enter)

Table B
Unique ID (PK)
Doc No (FK)
Info (to populate field 1)
Info (to populate field 2)

how do i perform this in the query section? do i need to manually code the SQL required, or is this query basic enough that i can just select the fields required in the design view of the query?

thanks guys
 
I would create a SELECT query to pull the data elements you want based on the form field. Then for each field use DLOOKUP to pull the value from that query.
In this way when the search criteria has been updated, all you have to do is refresh the controls and they should populate.
 

Users who are viewing this thread

Back
Top Bottom