D
David Patterson
I am having difficulty in setting up a DLookUp function for a control on a
form. I am using Access 2002.
I have a form (frmQuickEnterResourcesUsed), with subform, for users to enter
resource data. The principal form has two fields (unbound), RefNo and
WorkName and the subform allows users to input resource information about
the piece of work. The subform and main form are linked by RefNo (the
Primary Key for the whole database).
I want users to select the work item description from a combo box [WorkName]
and then from that automatically populate the RefNo which will then enable
the appropriate data in the subform to be viewed and updated/amended.
I have put a DLookUp statement as the Control for the RefNo field as
follows: =DLookUp("[RefNo]","[tblPrimary]","[WorkName] = & [Forms]!
[frmQuickEnterResourcesUsed]! [WorkName]")
I keep on getting either #Error or #Name in the RefNo field. I've used a
similar statement on other forms before OK. Any idea on what I might be
doing wrong?
Thanks,
David
form. I am using Access 2002.
I have a form (frmQuickEnterResourcesUsed), with subform, for users to enter
resource data. The principal form has two fields (unbound), RefNo and
WorkName and the subform allows users to input resource information about
the piece of work. The subform and main form are linked by RefNo (the
Primary Key for the whole database).
I want users to select the work item description from a combo box [WorkName]
and then from that automatically populate the RefNo which will then enable
the appropriate data in the subform to be viewed and updated/amended.
I have put a DLookUp statement as the Control for the RefNo field as
follows: =DLookUp("[RefNo]","[tblPrimary]","[WorkName] = & [Forms]!
[frmQuickEnterResourcesUsed]! [WorkName]")
I keep on getting either #Error or #Name in the RefNo field. I've used a
similar statement on other forms before OK. Any idea on what I might be
doing wrong?
Thanks,
David