Run-Time Error 2766

  • Thread starter Thread starter Rpettis31
  • Start date Start date
R

Rpettis31

The object doesn't contain the Automation object CAR.


Private Sub cmbxEmailCarRequest_Click()

Dim stDocName As String

stDocName = "CarRequest.Email Car Request"
' Define Strings for email
CAR = "CAR"
Iss = "Has been issued for item:"
Isss = "with the following issue:"
ass = "This issue has been assigned to,"
aud = "The audit results were :"

DoCmd.RunMacro stDocName

Exit_cmbxEmailCarRequest_Click:
Exit Sub

Err_cmbxEmailCarRequest_Click:
MsgBox Err.Description
Resume Exit_cmbxEmailCarRequest_Click

End Sub
 
This was just a macro in the macro window, I went to an event procedure and
this was the code I modified it to incorporate strings in the hope I could
get a longer message in the email body.

The CAR is the form the command button is on.

Should I be using a WithForms statement?

I am obviously doing something wrong and I am not that experienced in Access.
 
Back
Top