Some alternative expressions for the 3rd argument to try, Tony:
"[Unitname]=[control2]"
"[Unitname]=Control1.column(2)"
"[Unitname] = """ & Control1.column(2) & """"
If Unitname is a Number field (not a Text field), drop the quotes and handle
the Null case:
"[Unitname] = " & Nz(Control1.column(2),0)
If the subform has no records and no new records can be added, it goes blank
and these expressions will error.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Tony Williams" <(E-Mail Removed)> wrote in message
news:E7C35788-734D-4D0D-B0E5-(E-Mail Removed)...
>I have a form (frmmain) which has a subform (frmInput) and 3 controls on
>the
> subform.
> Control 1 is a drop down combo box based on a table (not the same one as
> the
> form)
> Control source of Control 2 is Control1.column(2)
> Control source of Control 3 is
> =DLookUp("[ADDRESS]","[Codes]","[Unitname]=Forms![frmmain]![frmInput].Form![control2]
>
> However I'm getting #Error in Control 3
> Can anyone help?
> Thanks
> Tony