Problem with DLookup on Report

T

Tony Williams

I have a report called rptIDCardForm on which there is a control called
Txt32 that has this Dlookup as its control source
=DLookUp("[txtbusaddress1]","[tblIndividual]","[txtmemnbr]=Reports!rptIDCardForm![txtempmemnumber]")
The report is based on tblindividual but I'm getting #Error in the control
on the report. Can anyone see anything wrong with the above statement?
Thanks
Tony
 
T

Tony Williams

Sorry folks found the problem, typo in a control reference and I've stared
at that for 2 hours!!!! How did I miss it? (I know - senility)
Tony
 
F

fredg

I have a report called rptIDCardForm on which there is a control called
Txt32 that has this Dlookup as its control source
=DLookUp("[txtbusaddress1]","[tblIndividual]","[txtmemnbr]=Reports!rptIDCardForm![txtempmemnumber]")
The report is based on tblindividual but I'm getting #Error in the control
on the report. Can anyone see anything wrong with the above statement?
Thanks
Tony

1) For one thing, make sure the name of this control is not the same
as any field used in it's control source expression.

2) Try the expression this way (the expression should be all on one
line):

=DLookUp("[txtbusaddress1]","[tblIndividual]","[txtmemnbr]=" &
Me![txtempmemnumber])

The above assumes [txtmemnbr] is a Number datatype.

However, if it is a Text datatype, then use:

..... "[txtmemnbr]= '" & Me![txtempmemnumber] & "'")
 

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

Similar Threads

Open report from a prompt form 4
Problem with IIF statment 6
Referencing from a combo box 4
DLookup problem 3
Help with If statement 17
Storing a calculated value 4
IIF statement help 13
Yet another DLookup problem! 5

Top