lookup sql statement

R

rigby

PLEASE can someone help me??

I am struggling so much with this one problem. I am not familiar with using
syntax, etc. in queries. what I need is this: I have 2 tables with these
relevant fields:
Table - Status
Fields - SW ID No(primary key),
Surname,
First Name.

Table - M/V Alaska
Fields - SW ID No,
Security Officer

Now, in the form M/V Alaska, I would like it to work so that when someone
types in the SW ID No in the appropraite field, then it will look up the
surname and first name (in that order) from the status table and place the
answer in the security officer's field without having to be manually typed in
each time.

then, i would like the M/V Alasks form to have its own unique reference
number each time someone makes new entries in it. but not each entry having a
unique number. its a timesheet so i need each set of entried to be recorded
under a specific ref. number. is this possible to automate or must it be
manually typed in each time.

Thank you in advance for any help.
Rigby
 
M

MAT4Ron

Sounds simple!
I like using Auto Id Numbering. But in the SQL statement you use as the
lookup field you format the info however you like and make the auto id number
not visible. This makes life easier so when you typo the vessel id number
you can go back and correct it.
On the second part I would make a Log Entry table with a One too Many
relationship. Then use that table as a sub form an the main form. If you
follow the sub form wizard it will ask what the relation fields are. If you
get it set up correctly referencing your auto id number (Primary Field) Every
time you pull up the M/V Record and make a log entry it will automatically
input the auto Id Number of the M/V record to the log entry.
 
Top