Using a query result in an expression

  • Thread starter Thread starter Phil Hood
  • Start date Start date
P

Phil Hood

I have a query that checks to see whether a record already
exists in a particular table. The result if it does is
that Expr1 = -1

My question is how do I refer to this result and use it in
an expression?

What I'm looking to do is to open a different form if the
result is -1 so I was thinking of using a If/Then/Else
statement but I don't know how to refer to the result of
the query in the 'if' statement.

Any help would be appreciated.

Thanks

Phil.
 
Phil

In queries, you use the IIF() function to accomplish If...Then...Else.
 
You can retrieve the results of a query using a domain aggregate function
such as DLookup().
If DLookup("YourField","YourQuery") = -1 Then
 

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

Back
Top