473,378 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

IsLoaded function not defined??

I have this code behind a report (same report as previous post);

Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "Report Date Range", , , , , acDialog, "Activity By
Location"

If Not IsLoaded("Report Date Range") Then
Cancel = True
End If
End Sub

This was copied from the sample database. It pops up a dialog to set the
date range filter. At run I get the compile error "function not defined" on
IsLoaded. if i comment out IF ...>>>>...End IF all is fine but I throw an
error if someone cancels the dialog box.

This works fine in the other database. The help file suggests: "You tried
to call a procedure from another project without explicitly adding a
reference to that project in the References dialog box."

Ummm........What? (realizing that he jumped into the deep end without
knowing how to swim)

This must be simple.

TIA
--
Mark Richards
ro********@hotmail.com
Nov 13 '05 #1
3 11452
Yes, very simple!

You can find the IsLoaded function in the Northwind sample database's
modules. Just copy it from there and paste it into a module in your database
and you will be good to go.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Mark Richards ro********@hotmail.com>" <<delete_this_part> wrote in message
news:O8********************@metrocastcablevision.c om...
I have this code behind a report (same report as previous post);

Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "Report Date Range", , , , , acDialog, "Activity By
Location"

If Not IsLoaded("Report Date Range") Then
Cancel = True
End If
End Sub

This was copied from the sample database. It pops up a dialog to set the
date range filter. At run I get the compile error "function not defined" on IsLoaded. if i comment out IF ...>>>>...End IF all is fine but I throw an
error if someone cancels the dialog box.

This works fine in the other database. The help file suggests: "You tried to call a procedure from another project without explicitly adding a
reference to that project in the References dialog box."

Ummm........What? (realizing that he jumped into the deep end without
knowing how to swim)

This must be simple.

TIA
--
Mark Richards
ro********@hotmail.com

Nov 13 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Found somewhere out there:

Function isLoaded(strName As String, _
Optional intType As Integer = acForm) As Boolean
' Get the current state of the named object

isLoaded = SysCmd(acSysCmdGetObjectState, _
intType, _
strName) = acObjStateOpen

End Function

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQdx3xYechKqOuFEgEQIE3ACfZ3+7Hl6rRVXDzlcKOIVrwz I8EXoAnjGs
vObQ2OVvfH2JQqz41z+ig31c
=/urL
-----END PGP SIGNATURE-----
Mark Richards < wrote:
At run I get the compile error "function not defined" on IsLoaded.

Nov 13 '05 #3
Mark Richards < wrote:
I have this code behind a report (same report as previous post);

Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "Report Date Range", , , , , acDialog, "Activity By
Location"

If Not IsLoaded("Report Date Range") Then
Cancel = True
End If
End Sub

This was copied from the sample database. It pops up a dialog to set the
date range filter. At run I get the compile error "function not defined" on
IsLoaded. if i comment out IF ...>>>>...End IF all is fine but I throw an
error if someone cancels the dialog box.

This works fine in the other database. The help file suggests: "You tried
to call a procedure from another project without explicitly adding a
reference to that project in the References dialog box."

Ummm........What? (realizing that he jumped into the deep end without
knowing how to swim)

This must be simple.

TIA


Access 2000 and newer can also use:

Public Function isLoaded(strFormName As String) As Boolean
IsLoaded = CurrentProject.AllForms(strFormName).IsLoaded
End Function

--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
12
by: Gaurav Veda | last post by:
Hi ! I am a poor mortal who has become terrified of Python. It seems to have thrown all the OO concepts out of the window. Penniless, I ask a basic question : What is the difference between a...
1
by: bbdata | last post by:
strange thing happened when i split my database. i have a search form where you enter parameters, and get back filtered records displayed on another form. when you close this one, theres a code in...
33
by: Pushkar Pradhan | last post by:
I'm using clock() to time parts of my code e.g. clk1 = clock(); /* code */ clk2 = clock(); /* calculate time in secs */ ...... clk1 = clock(); /* code */ clk2 = clock();
21
by: Stephen Biggs | last post by:
Given this code: void f(void){} int main(void){return (int)f+5;} Is there anything wrong with this in terms of the standards? Is this legal C code? One compiler I'm working with compiles this...
3
by: chreo | last post by:
I have user-defined function in MSSQL which returns Table (with 10 columns) (sorry for Polish names) CREATE FUNCTION PACZKI_Z_AKCJI (@AKCJA_ID int) RETURNS TABLE RETURN SELECT TOP 100...
7
imrosie
by: imrosie | last post by:
Hello, Is there anyone who can help me figure out how to resolve this conflict when I try to re-compile? It keeps telling the sub or routine is not defined...but it is!?! I think (I'm a newbie)...
21
by: H9XLrv5oXVNvHiUI | last post by:
Hi, I have a question about injecting friend functions within template classes. My question is specific to gcc (version 3.4.5) used in combination with mingw because this code (or at least code...
15
by: JohnHo | last post by:
here is the deal I have a form with a command button to open another form. I would like to check if another form is loaded and use the code to close that form. simple right? Dim obj As...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.