Compile error: Method or Data member not found

atrium

Registered User.
Local time
Tomorrow, 07:11
Joined
May 13, 2014
Messages
348
A very simple error BUT the highlighted field is declared as an unbound field.

Code:
Private Sub CopiesOKButt_Click()
   'MsgBox "PCopiesFld = " & Me.PCopiesFld
   If Me.SourceFormFld = "Clients" Then
      Forms![ViewPrintSendClientFrm]![CopiesReqFld] = Me.PCopiesFld
   Else
      Forms![ViewPrintSendFrm]![CopiesReqFld] = Me.PCopiesFld
   End If
   DoCmd.Close acForm, "PrintCopiesFrm", acSaveYes
End Sub

Me.PCopiesFld in line 4 of the code is highlighted when I compile with the error above.

All of the variables are declared. I don't have a problem running the form. It all works OK it's just when I go to compile this comes up as an error


Any ideas that help me overcome this problem will be appreciated

Atrium
 
the error message is telling you all - I presume if you uncomment your msgbox the error appears on the msgbox line?

check your spelling - and I presume you mean an unbound control, not field?

if you type me. then a list of the controls associated with the form will appear - is it in this list?

perhaps the control is on a subform and the code on the main form or the other way round

you say the form works ok if you don't compile - does this include clicking on CopiesOKButt?
 

Users who are viewing this thread

Back
Top Bottom