Compile error msg when opening form

mkdrep

Registered User.
Local time
Today, 16:31
Joined
Feb 6, 2014
Messages
181
I successfully set up a query that will pull the information I want. I have developed a report that when I open it manually works perfectly. [Job Process Call Report ASI Group]

The issue is that when I try to make a command button to open up]Job Process Call Report ASI Group] I get a compile error and then Visual Basic points where the problem is. Unfortunately, I don't understand what VBC is trying to tell me because I don't work in VBC.....

I have attached two (.jpgs) to give you a better idea of the problem.

Thanks for the help! :)
 

Attachments

  • String.jpg
    String.jpg
    34.9 KB · Views: 77
  • Compile error.jpg
    Compile error.jpg
    12.3 KB · Views: 109
You need this first:

Dim stDocName As String
 
You need this first:

Dim stDocName As String

Thank you for your answer Paul. As I mentioned, I have never used VBC, so where would I put the Text string above in the following routine?

Private Sub Open_Job_Process_Call_Report_ASI_Group_Click()
On Error GoTo Err_Open_Job_Process_Call_Report_ASI_Group_Click

stDocName = "Job Process Call Report ASI Group"

Exit_Open_Job_Process_Call_Report_ASI_Gr:
Exit Sub
Err_Open_Job_Process_Call_Report_ASI_Group_Click:
MsgBox Err.Description
Resume Exit_Open_Job_Process_Call_Report_ASI_Gr

End Sub

Thank you, Mark
 
I mentioned first, though that could be either before or after the On Error line. I typically put declarations first, so before the OnError line. Bottom line you have to declare it before you set it.
 

Users who are viewing this thread

Back
Top Bottom