G
Guest
This worked for me in 2003 but isn't working in 2000. Here is what I'm
currently doing.
If strBatch = DLookup("Batch", "tblBatchIsIn", "Batch = '" & txtBatch & "'")
= "all" Then
Do this
Else
Do that
End If
In Access 2003 when I used the DLookup command in an IF Statement, it would
return the value and base it on the comparison, doing this in Access 2000
yields nothing.
What I need to do is have an If statement pull a value from a table and if
it's the correct match, go on to do the first part of the If statemnt.
The Batch value will be unique per Queried tabled, so if there is and all in
the table it will be the only one.
Is it possible to use an SQL statement in an IF statement? I didn't try it
because I know in order to get SQL statements and queries to work that you
have to use the DoCmd.RunSQL command and that I don't know how (if it's
possible) to return a value from an SQL statement to a variable jus for an IF
statement.
TIA.
currently doing.
If strBatch = DLookup("Batch", "tblBatchIsIn", "Batch = '" & txtBatch & "'")
= "all" Then
Do this
Else
Do that
End If
In Access 2003 when I used the DLookup command in an IF Statement, it would
return the value and base it on the comparison, doing this in Access 2000
yields nothing.
What I need to do is have an If statement pull a value from a table and if
it's the correct match, go on to do the first part of the If statemnt.
The Batch value will be unique per Queried tabled, so if there is and all in
the table it will be the only one.
Is it possible to use an SQL statement in an IF statement? I didn't try it
because I know in order to get SQL statements and queries to work that you
have to use the DoCmd.RunSQL command and that I don't know how (if it's
possible) to return a value from an SQL statement to a variable jus for an IF
statement.
TIA.