Records/Forms/Querys

  • Thread starter Thread starter Fie
  • Start date Start date
F

Fie

hey,

am trying to get a form to open when i open up a report... that allows
user to enter in data range which is parameters from a query, but on
the On Open even in the report iv attached the followen code...

Private Sub Report_Open(Cancel As Integer)
' Open Sales by Year Dialog form.
' IsLoaded function (defined in Utility Functions module) determines
' if specified form is open.

Dim strDocName As String

strDocName = "frmDate"
' Set public variable to True so Sales by Year Dialog knows that
report
' is in its Open event.
blnOpening = True

' Open form.
DoCmd.OpenForm strDocName, , , , , acDialog

' If Sales by Year Dialog form isn't loaded, don't preview or print
report.
' (User clicked Cancel button on form.)
If IsLoaded(strDocName) = False Then Cancel = True

'Set public variable to False, signifying that Open event is
finished.
blnOpening = False
End Sub


but it highlights the followen lines when the code is run

Private Sub Report_Open(Cancel As Integer)
blnOpening = True


am working in access 97... has anyone any ideas how to solve this
ppppppppppppppplllllllllllllllllllllleeeeeeeeeeeeaaaaaaaasse help...

fie
 
Private Sub Report_Open(Cancel As Integer)
blnOpening = True

Where is blnOpening Dim'd, and how? In the same module (ok) or a
different one?

Do you get a compile error when you select Debug... Compile?

John W. Vinson[MVP]
 
yeah got compile error... am new to all this forms for parameters i
just copied code from database i found on website so possibly the code
aint right for my d.base. But this is same code used in few other
d.bases...

can you tell me how to do this from scratch casue am getting well
lost...
 
yeah got compile error... am new to all this forms for parameters i
just copied code from database i found on website so possibly the code
aint right for my d.base. But this is same code used in few other
d.bases...

can you tell me how to do this from scratch casue am getting well
lost...

No, I cannot; because I cannot see your database, do not know what
your table structure might be, and do not know what you're trying to
accomplish.

Care to give me some help here?

John W. Vinson[MVP]
 
Back
Top