Referencing a control on a subform

  • Thread starter Thread starter Tony Williams
  • Start date Start date
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
 
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
 
Back
Top