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

  • Thread starter Thread starter S. Matthew
  • Start date Start date
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
 
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
 
Back
Top