View Full Version : 2000 vs 2002 Version Conflict?


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

ghudson
07-06-2005, 11:07 AM
Check your references in any module. Fix any that state "MISSING".

JaedenRuiner
07-07-2005, 12:20 AM
Check your references in any module. Fix any that state "MISSING".


Which references? Do you mean "Tools | References" from the VBA menu? And should that be done on my system of the system that it having the errors?

Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner

Oldsoftboss
07-07-2005, 12:57 AM
I think A 2000 doesn't have opening Agrs on reports. I Declare a public variable in a module and reference that.

Second error, I think you have one too many commars and I dont think you need the brackets.


One other I know about:
DoCmd.OpenForm , , , , , acHidden
OK in 2002, crashes in 2000
(5 commars)

Docmd parameters:

Docmd.OpenForm FormName,View,Filter,Condition,DataMode,WindowMode ,OpenArgs

Dave