aqif
Registered User.
- Local time
- Today, 04:14
- Joined
- Jul 9, 2001
- Messages
- 158
Hi All
I am using lookup function like this
DLookup(" [Table1]![Field1] ", "Table1", " [Table1]![Field2]= [txtbox1]")
its working fine for me but I want to use a variable name in criteria like
Dim var1 as integer
var1 = 1
DLookup("
![Field1] ", "Table", "
![Field2]= var1")
I have also tried
DLookup(" [Table1]![Field1] ", "Table1", " [Table1]![Field2]= [var1]")
but its not working, rite now I m storing the value in an invisible text box and then referring the name of that text box name in criteria expression. Is there a way to directly use declared variables in criteria expression.
Cheers!
Aqif

I am using lookup function like this
DLookup(" [Table1]![Field1] ", "Table1", " [Table1]![Field2]= [txtbox1]")
its working fine for me but I want to use a variable name in criteria like
Dim var1 as integer
var1 = 1
DLookup("
I have also tried
DLookup(" [Table1]![Field1] ", "Table1", " [Table1]![Field2]= [var1]")
but its not working, rite now I m storing the value in an invisible text box and then referring the name of that text box name in criteria expression. Is there a way to directly use declared variables in criteria expression.
Cheers!
Aqif