Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help... FORM REFUSES TO OPEN!!!

Status
Not open for further replies.

Channah

IS-IT--Management
Jan 16, 2003
38
US
I have a form that will not open in a 2000 database that I created. When I click on the command button to open the form, it states "you cancelled the previous operation".
Here is the code for the cmdButton...

Private Sub Command145_Click()
On Error GoTo Err_Command145_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Access Members"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command145_Click:
Exit Sub
Err_Command145_Click:
MsgBox Err.Description
Resume Exit_Command145_Click
End Sub

Any ideas would be appreciated greatly... anyone ever seen it do this?
 
Hi!

Is there any code in Access Members?



Jeff Bridgham
bridgham@purdue.edu
 
This is a massive form... the original database was created by a former employee and I am in the process of trying to fix the damn thing... it is a nightmare. This is the code that "should" be behind Acccess Members... however, I can't even get into the VB of the form to view any issues. It is almost like the form doesn't exist??? Really strange. The form will not open in design view and when I try and run the documenter and analyser on it they will not work either... any ideas?

Option Compare Database
Option Explicit

Private Sub Close_Form_Click()
On Error GoTo Err_Close_Form_Click


DoCmd.Close

Exit_Close_Form_Click:
Exit Sub

Err_Close_Form_Click:
MsgBox Err.Description
Resume Exit_Close_Form_Click

End Sub
Private Sub Add_Click()
On Error GoTo Err_Add_Click


DoCmd.GoToRecord , , acNewRec

Exit_Add_Click:
Exit Sub

Err_Add_Click:
MsgBox Err.Description
Resume Exit_Add_Click

End Sub

Private Sub Command210_Click()

End Sub

Private Sub New_Record_Click()
On Error GoTo Err_New_Record_Click


DoCmd.GoToRecord , , acNewRec

Exit_New_Record_Click:
Exit Sub

Err_New_Record_Click:
MsgBox Err.Description
Resume Exit_New_Record_Click

End Sub
Private Sub Find_Record_Click()
On Error GoTo Err_Find_Record_Click


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Find_Record_Click:
Exit Sub

Err_Find_Record_Click:
MsgBox Err.Description
Resume Exit_Find_Record_Click

End Sub
Private Sub Access_Members_Click()
On Error GoTo Err_Access_Members_Click

Dim stDocName As String

stDocName = "MemberTypes"
DoCmd.OpenReport stDocName, acPreview

Exit_Access_Members_Click:
Exit Sub

Err_Access_Members_Click:
MsgBox Err.Description
Resume Exit_Access_Members_Click

End Sub
Private Sub Member_Status_Click()
On Error GoTo Err_Member_Status_Click

Dim stDocName As String

stDocName = "Find a Member Type"
DoCmd.OpenReport stDocName, acPreview

Exit_Member_Status_Click:
Exit Sub

Err_Member_Status_Click:
MsgBox Err.Description
Resume Exit_Member_Status_Click

End Sub
Private Sub Member_Types_Click()
On Error GoTo Err_Member_Types_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "MemberTypes"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Member_Types_Click:
Exit Sub

Err_Member_Types_Click:
MsgBox Err.Description
Resume Exit_Member_Types_Click

End Sub
Private Sub Find_Dup_Report_Click()
On Error GoTo Err_Find_Dup_Report_Click

Dim stDocName As String

stDocName = "Dup Report"
DoCmd.OpenReport stDocName, acPreview

Exit_Find_Dup_Report_Click:
Exit Sub

Err_Find_Dup_Report_Click:
MsgBox Err.Description
Resume Exit_Find_Dup_Report_Click

End Sub
Private Sub Start_Date_Click()
On Error GoTo Err_Start_Date_Click

Dim stDocName As String

stDocName = "Members By Date"
DoCmd.OpenReport stDocName, acPreview

Exit_Start_Date_Click:
Exit Sub

Err_Start_Date_Click:
MsgBox Err.Description
Resume Exit_Start_Date_Click

End Sub
Private Sub Date_and_ID_Click()
On Error GoTo Err_Date_and_ID_Click

Dim stDocName As String

stDocName = "Members"
DoCmd.OpenReport stDocName, acPreview

Exit_Date_and_ID_Click:
Exit Sub

Err_Date_and_ID_Click:
MsgBox Err.Description
Resume Exit_Date_and_ID_Click

End Sub

Private Sub Volunteer_Lables_Click()

End Sub

Private Sub Volunteers_Click()
On Error GoTo Err_Volunteers_Click

Dim stDocName As String

stDocName = "Volunteer List"
DoCmd.OpenReport stDocName, acPreview

Exit_Volunteers_Click:
Exit Sub

Err_Volunteers_Click:
MsgBox Err.Description
Resume Exit_Volunteers_Click

End Sub
Private Sub Interns_and_Volunteers_Click()
On Error GoTo Err_Interns_and_Volunteers_Click

Dim stDocName As String

stDocName = "Interns and Volunteers"
DoCmd.OpenReport stDocName, acPreview

Exit_Interns_and_Volunteers_Click:
Exit Sub

Err_Interns_and_Volunteers_Click:
MsgBox Err.Description
Resume Exit_Interns_and_Volunteers_Click

End Sub
Private Sub Volunteer_Labels_Click()
On Error GoTo Err_Volunteer_Labels_Click

Dim stDocName As String

stDocName = "Labels Members"
DoCmd.OpenReport stLabelsMembers, acPreview

Exit_Volunteer_Labels_Click:
Exit Sub

Err_Volunteer_Labels_Click:
MsgBox Err.Description
Resume Exit_Volunteer_Labels_Click

End Sub
Private Sub CCAP_Click()
On Error GoTo Err_CCAP_Click

Dim stDocName As String

stDocName = "CCAP Members"
DoCmd.OpenReport stDocName, acPreview

Exit_CCAP_Click:
Exit Sub

Err_CCAP_Click:
MsgBox Err.Description
Resume Exit_CCAP_Click

End Sub
Private Sub CCAP_Labels_Click()
On Error GoTo Err_CCAP_Labels_Click

Dim stDocName As String

stDocName = "CCAP Members Labels"
DoCmd.OpenReport stDocName, acNormal

Exit_CCAP_Labels_Click:
Exit Sub

Err_CCAP_Labels_Click:
MsgBox Err.Description
Resume Exit_CCAP_Labels_Click

End Sub
Private Sub CCAP_Lables_Click()
On Error GoTo Err_CCAP_Lables_Click

Dim stDocName As String

stDocName = "CCAP Members Labels"
DoCmd.OpenReport stDocName, acPreview

Exit_CCAP_Lables_Click:
Exit Sub

Err_CCAP_Lables_Click:
MsgBox Err.Description
Resume Exit_CCAP_Lables_Click

End Sub
Private Sub Incident_Report_Click()
On Error GoTo Err_Incident_Report_Click

Dim stDocName As String

stDocName = "Incident Report"
DoCmd.OpenReport stDocName, acPreview

Exit_Incident_Report_Click:
Exit Sub

Err_Incident_Report_Click:
MsgBox Err.Description
Resume Exit_Incident_Report_Click

End Sub
Private Sub problems_Click()
On Error GoTo Err_problems_Click

Dim stDocName As String

stDocName = "Incident Report"
DoCmd.OpenReport stDocName, acPreview

Exit_problems_Click:
Exit Sub

Err_problems_Click:
MsgBox Err.Description
Resume Exit_problems_Click

End Sub
Private Sub Edit_Schedule_Click()
On Error GoTo Err_Edit_Schedule_Click

Dim stDocName As String

stDocName = "Edit Schedule"
DoCmd.OpenReport stDocName, acPreview

Exit_Edit_Schedule_Click:
Exit Sub

Err_Edit_Schedule_Click:
MsgBox Err.Description
Resume Exit_Edit_Schedule_Click

End Sub
Private Sub Studio_Click()
On Error GoTo Err_Studio_Click

Dim stDocName As String

stDocName = "Studio Schedule"
DoCmd.OpenReport stDocName, acPreview

Exit_Studio_Click:
Exit Sub

Err_Studio_Click:
MsgBox Err.Description
Resume Exit_Studio_Click

End Sub
Private Sub Mobile_Schedule_Click()
On Error GoTo Err_Mobile_Schedule_Click

Dim stDocName As String

stDocName = "Mobile Studio Schedule"
DoCmd.OpenReport stDocName, acPreview

Exit_Mobile_Schedule_Click:
Exit Sub

Err_Mobile_Schedule_Click:
MsgBox Err.Description
Resume Exit_Mobile_Schedule_Click

End Sub
Private Sub Equip_Click()
On Error GoTo Err_Equip_Click

Dim stDocName As String

stDocName = "Equipment Schedule"
DoCmd.OpenReport stDocName, acPreview

Exit_Equip_Click:
Exit Sub

Err_Equip_Click:
MsgBox Err.Description
Resume Exit_Equip_Click

End Sub
Private Sub Ctl15_Click()
On Error GoTo Err_Ctl15_Click

Dim stDocName As String

stDocName = "15 Schedule"
DoCmd.OpenReport stDocName, acPreview

Exit_Ctl15_Click:
Exit Sub

Err_Ctl15_Click:
MsgBox Err.Description
Resume Exit_Ctl15_Click

End Sub
Private Sub Ctl13_Weeks_Click()
On Error GoTo Err_Ctl13_Weeks_Click

Dim stDocName As String

stDocName = "13 Week Rule"
DoCmd.OpenReport stDocName, acPreview

Exit_Ctl13_Weeks_Click:
Exit Sub

Err_Ctl13_Weeks_Click:
MsgBox Err.Description
Resume Exit_Ctl13_Weeks_Click

End Sub
Private Sub Shows_Click()
On Error GoTo Err_Shows_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Programming Subform"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Shows_Click:
Exit Sub

Err_Shows_Click:
MsgBox Err.Description
Resume Exit_Shows_Click

End Sub
Private Sub Class_Click()
On Error GoTo Err_Class_Click

Dim stDocName As String

stDocName = "Training Class Schedule for Access"
DoCmd.OpenReport stDocName, acPreview

Exit_Class_Click:
Exit Sub

Err_Class_Click:
MsgBox Err.Description
Resume Exit_Class_Click

End Sub
Private Sub Chart_Click()
On Error GoTo Err_Chart_Click

Dim stDocName As String

stDocName = "Chart Edit use"
DoCmd.OpenReport stDocName, acPreview

Exit_Chart_Click:
Exit Sub

Err_Chart_Click:
MsgBox Err.Description
Resume Exit_Chart_Click

End Sub
Private Sub Command212_Click()
On Error GoTo Err_Command212_Click

Dim stDocName As String

stDocName = "Labels Members"
DoCmd.OpenReport stDocName, acPreview

Exit_Command212_Click:
Exit Sub

Err_Command212_Click:
MsgBox Err.Description
Resume Exit_Command212_Click

End Sub
Private Sub Command217_Click()
On Error GoTo Err_Command217_Click

Dim stDocName As String

stDocName = "Sponsors mailings"
DoCmd.OpenReport stDocName, acPreview

Exit_Command217_Click:
Exit Sub

Err_Command217_Click:
MsgBox Err.Description
Resume Exit_Command217_Click

End Sub
 
It sounds like the database is secured with a work group file and has had security run on it? Can you create a new unsecured database and import the objects from the old?
 
Thought of that... the database is not secured. Everything else in the database works great. There are no other problems or anything. It is a very simple application that is accessed by about three users. I can open every single other form and table etc. with no issue. Furthermore, when I imported a new form with the same attributes as the one that is giving me issues and renamed it to see what it would do, it would not open either (datasheet, form, or design view). This is really wierding me out. I have a backup copy that is working fine in the meantime, but I really need to figure this thing out.
 
Hi again!

I don't see anything in the code that would cause the error you posted. Look on the data sheet to see if the On Load or On Open events are firing a macro. Also, does the form have a record source and, if it does, what is it?



Jeff Bridgham
bridgham@purdue.edu
 
The record source for the form is a data table with only about 180 records. There is no reason that it should be causing a problem. Oh well... I think that I will resort to the backup copy that I have and hope that this doesn't happen again. Anyother ideas on this would still be greatly appreciated as I love to try and figure out this kind of thing. Thanks again guys
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top