Check if value exists in a table

  • Thread starter Thread starter Ross
  • Start date Start date
R

Ross

In VB, how could I get a boolean value returned, depending
on if a constant (e.g.1.02) is present in a table. I am
doing this for version control. Thanks.
 
This may do what you seek:

BooleanValue = (DLookup("FieldName", "TableName",
"[PrimaryKeyFieldName]='SomeValue'")="1.02")

If true, the value exists; if false, it doesn't.
 
Back
Top