IF Statement

  • Thread starter Thread starter David
  • Start date Start date
D

David

I am trying to create an IF statement where I check if the
combo box text on a form is equal to a field in a table.
I know how to referance the combo box on the form but
don't know and can't figure out how to check if it is the
same in the table. Here is the code that I have now but
it doesn't work....

If Me.cboContactName.Text =
![tblContacts].
[FirstName] Then

.....
.....

End If

Anyone know how to properly check the table. I remember
using something awhile ago but can't remember what I did.
Any help would be great.

Thanks,

Dave
 
I am trying to create an IF statement where I check if the
combo box text on a form is equal to a field in a table.

Well: nothing can really be equal to a value in a field in a table: a field
can contain millions of values, one for each record!

If you can define which record you need to look up this value, then you are
in business:

If cboContactName.Value = _
DLookup("FirstName", "tblContacts", "LastName = ""Smith""") Then



Hope that helps

Tim F
 
Back
Top