Referencing a control on a subform

T

Tony Williams

I have a control on a subform whose control source is this:
=DLookUp("[txtstatus]","[StatusCodes]","[txtstatuscode]=Forms![frmmain]![frmvehicle].Form.[txtstatus]")

However when I open the form I get #Error blinking in thr control as if it's
running through the records.

I've Googled referencing subforms and I thought I'd followed the advice but
there's obviously something wrong. I'm sure I've used this format before and
its worked OK.

Anyone any ideas?
Thanks
Tony
 
T

Tony Williams

Thanks Daniel. That expression gives me a #Name? error?
Tony

Daniel Pineault said:
Try something more like

=DLookUp("[txtstatus]","[StatusCodes]","[txtstatuscode]='" &
Forms![frmmain]![frmvehicle].Form.[txtstatus] & "'")
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



Tony Williams said:
I have a control on a subform whose control source is this:
=DLookUp("[txtstatus]","[StatusCodes]","[txtstatuscode]=Forms![frmmain]![frmvehicle].Form.[txtstatus]")

However when I open the form I get #Error blinking in thr control as if it's
running through the records.

I've Googled referencing subforms and I thought I'd followed the advice but
there's obviously something wrong. I'm sure I've used this format before and
its worked OK.

Anyone any ideas?
Thanks
Tony
 

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

Top