aqif
07-15-2001, 07:22 PM
Hi All http://www.access-programmers.co.uk/ubb/smile.gif
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(" [Table]![Field1] ", "Table", " [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(" [Table]![Field1] ", "Table", " [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