Hi @isladogs,
I have somewhat a same issue with respect to #name error. Can you help me what would be an ideal solution for this?
I have a form which populates records. For each record, there is a button on the right which, on click would take the ID from the record and populate all the other columns into a 2nd form (frm_CPS_EDIT).
But when I run the code, the new form that opens always gets the #name error.
Below is my code.
Code:
strSQL = "SELECT P.CPS_REP_ID FROM table AS P WHERE P.CPS_REP_ID = '" & Me.CPS_REP_ID & "' ;"
r.Open strSQL, DC.DATA, adOpenKeyset, adLockOptimistic
DoCmd.OpenForm "frm_CPS_EDIT", , , "[CPS_REP_ID] = '" & Me.CPS_REP_ID & "'"
Originally Posted by
isladogs
If the code is in the subform, just use the Me. prefix.
Otherwise, you need the full Forms!mainformname.subformlname.form.[Product_ID]
OR substitute with Me. For first part if in main form
Or substitute first part with Parent. If in subform
Personally, I'd use the first of these four options if code is in the subform