Hi All
I am currently upgrading a DB from Access 2000 to 2007.
I have been using a Form "Report Date Range" which has the following :
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "Report Date Range", , , , , acDialog, "Payments Due"
If Not IsLoaded("Report Date Range") Then
Cancel = True
End If
End Sub
Private Sub Report_Close()
DoCmd.Close acForm, "Report Date Range"
End Sub
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There is no data for this report. Canceling report..."
Cancel = -1
End Sub
This works fine in 2000 but I get error message in 2007:
MS VB -- Compile Error: Sub or Function not defined, with "IsLoaded"
highlighted, I have not been able find a solution, can anyone help.
Thanks in advance
Davo
Allen Browne - 28 Dec 2007 06:35 GMT
IsLoaded() is not a built-in function. It does appear in the Northwind
sample database, so may people copy it from there.
The error may mean any of these:
a) You don't have the IsLoaded() function in your database.
b) The IsLoaded() function is in the wrong place (e.g. in the module of a
form, when you need it in a standard module.)
c) The database is partically corrupt, and needs a decompile. Post back if
you need details of this.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Hi All
>
[quoted text clipped - 22 lines]
> Thanks in advance
> Davo
Davo78 - 28 Dec 2007 06:54 GMT
Allen
Thank you for your prompt reply
How can I check if IsLoaded() function is in my database.
I copied the Report Date Range from Northwind
Davo
> IsLoaded() is not a built-in function. It does appear in the Northwind
> sample database, so may people copy it from there.
[quoted text clipped - 35 lines]
> > Thanks in advance
> > Davo
Allen Browne - 28 Dec 2007 08:20 GMT
Open any module.
In the code window, use Find on the Edit menu.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Allen
> Thank you for your prompt reply
[quoted text clipped - 3 lines]
>
> Davo
Davo78 - 29 Dec 2007 06:13 GMT
Allen
The search only finds 1 reference and that is in the "Reort Date Range" code.
How can I add this,
Thanks again
Davo
> Open any module.
>
[quoted text clipped - 7 lines]
> >
> > Davo
Allen Browne - 29 Dec 2007 07:18 GMT
You can copy it from Northwind.mdb (find it on your hard drive), the
Utilities module. Paste it into a new module.
Alternatively, you could just change the line:
If Not IsLoaded("Report Date Range") Then
to:
If CurentProject.AllForms("Report Date Range").IsLoaded Then

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Allen
> The search only finds 1 reference and that is in the "Reort Date Range"
[quoted text clipped - 14 lines]
>> >
>> > I copied the Report Date Range from Northwind
Davo78 - 30 Dec 2007 01:14 GMT
Allen
IsLoaded is installed in "Access-AccessObject" of my current project the
same as in Northwind, this still does not work.
I tried your suggested code change, this displays the Form "Report Date
Range" and allows date inputs, but stops on the line If
CurentProject.AllForms("Report Date Range").IsLoaded Then
Any suggestions
Davo
> You can copy it from Northwind.mdb (find it on your hard drive), the
> Utilities module. Paste it into a new module.
[quoted text clipped - 22 lines]
> >> >
> >> > I copied the Report Date Range from Northwind
Allen Browne - 30 Dec 2007 06:39 GMT
I don't have any other suggestions.
CurrentProject is part of the Access library.
IsLoaded() is from Northwind.
Take your pick.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Allen
>
[quoted text clipped - 6 lines]
>
> Davo
Davo78 - 30 Dec 2007 09:34 GMT
Allen
Thanks for your help and interest.
Davo
> I don't have any other suggestions.
>
[quoted text clipped - 14 lines]
> >
> > Davo
Davo78 - 30 Dec 2007 10:45 GMT
Allen
Using If CurentProject.AllForms("Report Date Range").IsLoaded Then
I now get
Error message "Object required"
Thanks again
Davo
> Allen
>
[quoted text clipped - 20 lines]
> > >
> > > Davo
Allen Browne - 30 Dec 2007 12:10 GMT
Davo, I may have to leave the debugging side with you.
It could even be something simple like double-r.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Allen
>
[quoted text clipped - 4 lines]
> Thanks again
> Davo