I have a main form "fmEmpHWList2" inside it there are two subforms. In the subform "frmSWList2" I have textfields that I'm using Dlookup functions to get values from a table. When I tested this on the subform alone everything worked. But when I brought the subform into the main form I get the "#Name?" error.
Here is my current code within the mainform that gives me the error and I need to fix:
=DLookUp("Version","EmpSWSum","Software = '7-Zip' AND EmpID=" & [Forms]![fmEmpHWList2]![frmSWList2].[Form]![EmpID])
In the subform alone this code works
=DLookUp("Version","EmpSWSum","Software = 'ADG R4i CSDB Client' AND EmpID=" & [Forms]![frmSWList2]![EmpID])
Things to note: EmpID is a number
I appreciate your taking the time to help me solve this
Me!Subform1.Form!ControlName
– Ryan WildryMe
is not a valid reference inside a Control Source property... at least Access always automatically wraps it like[Me]
and then returns an error. Is the table you linked to for referencing within VBA modules? – C Perkins=[subformCONTROLname].[Name]
. 3) View the main form. The new textbox should simply show the name of the subform control. If that works, then add a 2nd new textbox with=[subformCONTROLname]![EmpID]
. – C Perkins