I am updating a database from Access 1995 (yes) to Access 2007. Due to the macro and calculated fields, I can not update this database to 2000, then to 2003, then to 2007. It simply won't update. So I am re-creating the database. I have a form that takes the results from option buttons (which picks which report to generate), so an if statement. There are also several combo box fields in which the user can pick user name, date, class. etc. I copied the Macro into a word document and pasted it into the 2007 document. Set up all the fields; however, as expected it did not run. I don't do programming very well, so I do not understand exactly what is failing. Here is the code:
Private Sub Command12_Click()
Dim res As Recordset
Dim Chz As Integer
Chz=Forms!Edreports!Frame0
Ok, this is where the debugger stops with an error on Frame0 . (Run-time error 2465: Can't find the field Frame 0 referred to in your expression. What exactly does this mean? I simply don't see any field that is referred to as Frame0 in the database. The rest of the code is below.
If Check63 Then
Chz=Chz*10
End If
Select Case Chz
Case 1 'Attendance Report
IfIsNull(Combo31) Then
DoCmd.OpenReport "EdRep4a", acPreview 'for Class
Else
DoCmd.OpenReport "EdRep4b", acPreview 'for Employee
End If
Case 2 'Non Attend Reminder List
DoCmd.OpenReport "EdRep6", acPreview
Case 3 'Non Attend Reminder List
DoCmd.OpenReport "EdRep5", acPreview
Case 4 'Annual Report
DoCmd.OpenReport "EdRep0", acPreview
Case 5 'Print Names
DoCmd.OpenReport "EdRep7", acPreview
Case 6 'Print Appraisal by date
DoCmd.OpenReport "EdRep6", acPreview
Case 10 'Class by Department-Break by Department
DoCmd.OpenReport "EdRep4", acPreview 'for Class
Case 20 'Non Attendance Reminder List- Break by department
DoCmd.OpenReport "EdRep4b", acPreview
End Select
End Sub
Private Sub Command12_Click()
Dim res As Recordset
Dim Chz As Integer
Chz=Forms!Edreports!Frame0
Ok, this is where the debugger stops with an error on Frame0 . (Run-time error 2465: Can't find the field Frame 0 referred to in your expression. What exactly does this mean? I simply don't see any field that is referred to as Frame0 in the database. The rest of the code is below.
If Check63 Then
Chz=Chz*10
End If
Select Case Chz
Case 1 'Attendance Report
IfIsNull(Combo31) Then
DoCmd.OpenReport "EdRep4a", acPreview 'for Class
Else
DoCmd.OpenReport "EdRep4b", acPreview 'for Employee
End If
Case 2 'Non Attend Reminder List
DoCmd.OpenReport "EdRep6", acPreview
Case 3 'Non Attend Reminder List
DoCmd.OpenReport "EdRep5", acPreview
Case 4 'Annual Report
DoCmd.OpenReport "EdRep0", acPreview
Case 5 'Print Names
DoCmd.OpenReport "EdRep7", acPreview
Case 6 'Print Appraisal by date
DoCmd.OpenReport "EdRep6", acPreview
Case 10 'Class by Department-Break by Department
DoCmd.OpenReport "EdRep4", acPreview 'for Class
Case 20 'Non Attendance Reminder List- Break by department
DoCmd.OpenReport "EdRep4b", acPreview
End Select
End Sub