I am still working my way up the Access moutian. I am working on a project that lets users search the database for a number of different items, which will then generate a report. I just cannot figure it out. I tried this code that developed a dialog box, but I get the runtime error 2585. The debug sends me to the line that I've labeled with a sad face.
Option Compare Database
Private Sub Command8_Click()
Me.Visible = False
DoCmd.OpenReport "Productivity", , , , acDialog
DoCmd.Close acForm, "Report Filter"
End Sub
Private Sub Cancel_Click()
DoCmd.Close
End Sub
Private Sub Command9_Click()
DoCmd.Close 'Close Form
End Sub
Private Sub Form_Open(Cancel As Integer)
If Not bInReportOpenEvent Then
' If we're not called from the report
MsgBox "For use from the Productivity Report only", vbOKOnly
Cancel = True
End If
Form_Open_Exit:
Exit Sub
End Sub
Private Sub OK_Click()
Me.Visible = False
End Sub
I am new to this and any help to learn that I could get would be great.
Option Compare Database
Private Sub Command8_Click()
Me.Visible = False
DoCmd.OpenReport "Productivity", , , , acDialog
DoCmd.Close acForm, "Report Filter"
End Sub
Private Sub Cancel_Click()
DoCmd.Close
End Sub
Private Sub Command9_Click()
DoCmd.Close 'Close Form
End Sub
Private Sub Form_Open(Cancel As Integer)
If Not bInReportOpenEvent Then
' If we're not called from the report
MsgBox "For use from the Productivity Report only", vbOKOnly
Cancel = True
End If
Form_Open_Exit:
Exit Sub
End Sub
Private Sub OK_Click()
Me.Visible = False
End Sub
I am new to this and any help to learn that I could get would be great.
Last edited: