Check if value exists in a table

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.
 
K

Ken Snell

This may do what you seek:

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

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

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