Let me make this queston simpler. If I put "=me.audfield" in the
controlSource for the unbound field, I still get an error #Name? in the
unbound field. And yes, me.audfield refers to a bound field on the form.
How can I populate the unbound field by using fields on the form at startup?
:
Again, I don't think the problem is syntax as the following statement works
fine with the Button Click event:
Me.CurrentValue = DLookup("[" & Me.audField & "]", Me.audTable, "CourseID =
" & Me.recordID)
The brackets are needed because Me.audField may have a space in it.
I did try the Forms![formname]![fieldname] format and the result is still
the error: #Name?
My guess is that I'm trying to ControlSource the field before other field
values are actually there. Any other thoughts?
:
Hi stu,
Check this out:
http://www.techonthenet.com/access/functions/domain/dlookup.php
You aren't going to find the 'Me' reference in any of the examples in terms
of the field argument, and I've never seen it done before. I'm not saying
it's definitely wrong....but I'd change it if I were trying to troubleshoot
it.
You also have done the brackets in the field argument in an odd way I've
never seen. I would just do them the way this link does them.
At worst, it's another link you can add to your collection
HTH,
CW
:
Yes, field name is: Me.audField (with brackets added)
table name is: Me.audTable
I don't think the problem is syntax as I have tested it with a button click
event.
:
Don't have your tables in front of me, but the syntax for dlookup is field,
table, criteria:
=DLookUp(" Field in table ", "TheTable", "CourseID = " & Me.recordID)
Damon
Trying to populate an unbound field using continuous forms when the form
opens. I have the following in the ControlSource of the unbound field:
=DLookUp("[" & Me.audField & "]",Me.audTable,"CourseID = " & Me.recordID)
Getting #Name? error in the unbound field.
Any help on getting the unbound field populated is appreciated. (Also got
on error when attempting VBA code in the On Current event)