Dialog Form Code

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.
 
D

Douglas J. Steele

IsLoaded isn't a built-in function. Check your old database for the code,
and copy it into your new one.
 
D

Dale Fye

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top