JaedenRuiner
07-06-2005, 11:04 AM
Hola,
I was wondering if there is a VBA version difference between Access 2000 and Access 2002. I am developing on 2002, (but the convert database says i'm working with 2000 compatability), and the database is being used on a 2000 system.
I have two objects, a form and a report, and this is their primary methods:
' Report_flfl_report
Private Sub Report_Open(Cancel As Integer)
Dim ArgStr As String
Cancel = IsNull(Me.OpenArgs) '<--Second time compile error on OpenArgs saying invalid method/field
If Not Cancel Then
ArgStr = Me.OpenArgs
Debug.Print ArgStr
Me.Filter = ArgStr
Me.FilterOn = True
Else
DoCmd.OpenForm "reportForm", acNormal
Debug.Print "Open Form"
End If
End Sub
' Form_reportForm
Private Sub OkButton_Click()
Dim cmdStr As String
cmdStr = ""
If OptionFrame.value = 2 Then
cmdStr = "[Department] = " & DeptCmb.value
ElseIf OptionFrame.value = 3 Then
cmdStr = "[Area] = " & AreaCmb.value
End If
cmdStr = cmdStr & IIf(cmdStr = "", "", " AND ") & "[Shift_ID] = " & ShiftCmb.value
Call DoCmd.Close(acForm, "reportForm", acSaveNo)
Call DoCmd.OpenReport("flf_report", acViewPreview, , , , cmdStr) '<--first time it had a compile error with this line
End Sub
The design is flawless in my 2002 system. If you run the report, it opens the form and asks for parameters to the report, and then opens the report preview when the okay button is clicked.
If you Run the form, it just runs, and the opens the report. However i'm getting both of those compile errors in Access 2000, and wondering why, and how i can fix it.
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner
I was wondering if there is a VBA version difference between Access 2000 and Access 2002. I am developing on 2002, (but the convert database says i'm working with 2000 compatability), and the database is being used on a 2000 system.
I have two objects, a form and a report, and this is their primary methods:
' Report_flfl_report
Private Sub Report_Open(Cancel As Integer)
Dim ArgStr As String
Cancel = IsNull(Me.OpenArgs) '<--Second time compile error on OpenArgs saying invalid method/field
If Not Cancel Then
ArgStr = Me.OpenArgs
Debug.Print ArgStr
Me.Filter = ArgStr
Me.FilterOn = True
Else
DoCmd.OpenForm "reportForm", acNormal
Debug.Print "Open Form"
End If
End Sub
' Form_reportForm
Private Sub OkButton_Click()
Dim cmdStr As String
cmdStr = ""
If OptionFrame.value = 2 Then
cmdStr = "[Department] = " & DeptCmb.value
ElseIf OptionFrame.value = 3 Then
cmdStr = "[Area] = " & AreaCmb.value
End If
cmdStr = cmdStr & IIf(cmdStr = "", "", " AND ") & "[Shift_ID] = " & ShiftCmb.value
Call DoCmd.Close(acForm, "reportForm", acSaveNo)
Call DoCmd.OpenReport("flf_report", acViewPreview, , , , cmdStr) '<--first time it had a compile error with this line
End Sub
The design is flawless in my 2002 system. If you run the report, it opens the form and asks for parameters to the report, and then opens the report preview when the okay button is clicked.
If you Run the form, it just runs, and the opens the report. However i'm getting both of those compile errors in Access 2000, and wondering why, and how i can fix it.
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner