Command button not working!

C

Cesar Urquidi

I created a command button in a form to open a report, and it was working
fine, but now it doesn't work.
I get the following "Microsoft Visual Basic" window message:
Module not found

Why?
How can I make it work again?
 
C

Cesar Urquidi

I have multiple commands, here's the code for all commands:

Private Sub Equipment__Active___By_Device_ID__Click()
On Error GoTo Err_Equipment__Active___By_Device_ID__Click

Dim stDocName As String

stDocName = "Equipment (Active) (By Device ID)"
DoCmd.OpenReport stDocName, acPreview

Exit_Equipment__Active___By_Device_ID__C:
Exit Sub

Err_Equipment__Active___By_Device_ID__Click:
MsgBox Err.Description
Resume Exit_Equipment__Active___By_Device_ID__C

End Sub
Private Sub Equipment__Inactive___By_Device_ID__Click()
On Error GoTo Err_Equipment__Inactive___By_Device_ID__Click

Dim stDocName As String

stDocName = "Equipment (Inactive) (By Device ID)"
DoCmd.OpenReport stDocName, acPreview

Exit_Equipment__Inactive___By_Device_ID_:
Exit Sub

Err_Equipment__Inactive___By_Device_ID__Click:
MsgBox Err.Description
Resume Exit_Equipment__Inactive___By_Device_ID_

End Sub
Private Sub Equipment__Missing_Lost___By_Device_ID__Click()
On Error GoTo Err_Equipment__Missing_Lost___By_Device_ID__Click

Dim stDocName As String

stDocName = "Equipment (Missing/Lost) (By Device ID)"
DoCmd.OpenReport stDocName, acPreview

Exit_Equipment__Missing_Lost___By_Device:
Exit Sub

Err_Equipment__Missing_Lost___By_Device_ID__Click:
MsgBox Err.Description
Resume Exit_Equipment__Missing_Lost___By_Device

End Sub
Private Sub Equipment_Calibration_Due_Soon__By_Device_ID__Click()
On Error GoTo Err_Equipment_Calibration_Due_Soon__By_Device_ID__Click

Dim stDocName As String

stDocName = "Equipment Calibration Due Soon (By Device ID)"
DoCmd.OpenReport stDocName, acPreview

Exit_Equipment_Calibration_Due_Soon__By_:
Exit Sub

Err_Equipment_Calibration_Due_Soon__By_Device_ID__Click:
MsgBox Err.Description
Resume Exit_Equipment_Calibration_Due_Soon__By_

End Sub
Private Sub
Equipment_Calibration_Due_Soon__By_Next_Scheduled_Calibration__Click()
On Error GoTo
Err_Equipment_Calibration_Due_Soon__By_Next_Scheduled_Calibration__Click

Dim stDocName As String

stDocName = "Equipment Calibration Due Soon (By Next Scheduled
Calibration)"
DoCmd.OpenReport stDocName, acPreview

Exit_Equipment_Calibration_Due_Soon__By_:
Exit Sub

Err_Equipment_Calibration_Due_Soon__By_Next_Scheduled_Calibration__Click:
MsgBox Err.Description
Resume Exit_Equipment_Calibration_Due_Soon__By_

End Sub
Private Sub Equipment_Calibration_Past_Due__By_Device_ID__Click()
On Error GoTo Err_Equipment_Calibration_Past_Due__By_Device_ID__Click

Dim stDocName As String

stDocName = "Equipment Calibration Past Due (By Device ID)"
DoCmd.OpenReport stDocName, acPreview

Exit_Equipment_Calibration_Past_Due__By_:
Exit Sub

Err_Equipment_Calibration_Past_Due__By_Device_ID__Click:
MsgBox Err.Description
Resume Exit_Equipment_Calibration_Past_Due__By_

End Sub
Private Sub
Equipment_Calibration_Past_Due__By_Next_Scheduled_Calibration__Click()
On Error GoTo
Err_Equipment_Calibration_Past_Due__By_Next_Scheduled_Calibration__Click

Dim stDocName As String

stDocName = "Equipment Calibration Past Due (By Next Scheduled
Calibration)"
DoCmd.OpenReport stDocName, acPreview

Exit_Equipment_Calibration_Past_Due__By_:
Exit Sub

Err_Equipment_Calibration_Past_Due__By_Next_Scheduled_Calibration__Click:
MsgBox Err.Description
Resume Exit_Equipment_Calibration_Past_Due__By_

End Sub
Private Sub Equipment_Issued___Not_Returned__By_Device_ID__Click()
On Error GoTo Err_Equipment_Issued___Not_Returned__By_Device_ID__Click

Dim stDocName As String

stDocName = "Equipment Issued & Not Returned (By Device ID)"
DoCmd.OpenReport stDocName, acPreview

Exit_Equipment_Issued___Not_Returned__By:
Exit Sub

Err_Equipment_Issued___Not_Returned__By_Device_ID__Click:
MsgBox Err.Description
Resume Exit_Equipment_Issued___Not_Returned__By

End Sub
Private Sub Equipment_Issued___Not_Returned__By_Issue_Date__Click()
On Error GoTo Err_Equipment_Issued___Not_Returned__By_Issue_Date__Click

Dim stDocName As String

stDocName = "Equipment Issued & Not Returned (By Issue Date)"
DoCmd.OpenReport stDocName, acPreview

Exit_Equipment_Issued___Not_Returned__By:
Exit Sub

Err_Equipment_Issued___Not_Returned__By_Issue_Date__Click:
MsgBox Err.Description
Resume Exit_Equipment_Issued___Not_Returned__By

End Sub
Private Sub Close_Reports_Form_Click()
On Error GoTo Err_Close_Reports_Form_Click


DoCmd.Close

Exit_Close_Reports_Form_Click:
Exit Sub

Err_Close_Reports_Form_Click:
MsgBox Err.Description
Resume Exit_Close_Reports_Form_Click

End Sub
Private Sub
Equipment_To_Calibration__Filter_Calibration_Date___Supplier__Click()
On Error GoTo
Err_Equipment_To_Calibration__Filter_Calibration_Date___Supplier__Click

Dim stDocName As String

stDocName = "Equipment To Calibration (Filter Calibration Date &
Supplier)"
DoCmd.OpenReport stDocName, acPreview

Exit_Equipment_To_Calibration__Filter_Ca:
Exit Sub

Err_Equipment_To_Calibration__Filter_Calibration_Date___Supplier__Click:
MsgBox Err.Description
Resume Exit_Equipment_To_Calibration__Filter_Ca

End Sub
 
B

boblarson

Did you rename anything? It sounds like you might have tried to rename
something and now it can't find it (if it was working at one point).
--
Bob Larson

Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top