From a form check if a name exists on a different table

S

S. Matthew

When I select a name from a combo box in a form I would
like it to search another table to check if the selected
name exists. If the name exists in the table a flag
image should appear on the form.

Please help me write the code for this operation.

Thanks
S. Matthew
 
T

TK

Probably the easiest way is to use the DLookup function
If DLookup("nameField","table to check","nameField = '" & me.your combo box
control name & "'") Then
turn on your flag
End if

The above assumes your name field is a text field - so you use the single
quote inside the double quotes.
HTH

TK
 

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