Dialog Form Code

  • Thread starter Thread starter Rene
  • Start date Start date
R

Rene

A visual basic function I used in Access 03 is not working in Access 07.

Basically, I copied and pasted the following code into the On Open and On
Close Event of the report, as I'm transferring everything from Access 03 to
07:

--------------------------------------------------------------

Option Compare Database

Private Sub Report_Close()
DoCmd.Close acForm, "rptdlgfrm_Date Range"
End Sub

Private Sub Report_Open(Cancel As Integer)

bInReportOpenEvent = True

DoCmd.OpenForm "rptdlgfrm_Date Range", , , , , acDialog

If IsLoaded("rptdlgfrm_Date Range") = False Then Cancel = True

bInReportOpenEvent = False

End Function

--------------------------------------------------------------

When I run the report, the visual basic window comes up and displays the
following message:

Compile error: Sub or Function not defined.
 
IsLoaded isn't a built-in function. Check your old database for the code,
and copy it into your new one.
 
My first guess would be that you don't have a function IsLoaded in your new
database.

Try this:

If currentproject.Allforms("prgdlgfrm_Date Range").isloaded = False then
Cancel = true
 
Back
Top