473,387 Members | 1,515 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,387 software developers and data experts.

How to find out if a form exists?

If Form A opens Form B with a filter set based a value on Form A. Then
I closed Form A, in navigating Form B, I got some error says Access can
not find Form A.
How can I detect this programatically in the code?
Thanks,
ming

Nov 13 '05 #1
4 8804
"swingingming" <mi******@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
If Form A opens Form B with a filter set based a value on Form A. Then
I closed Form A, in navigating Form B, I got some error says Access can
not find Form A.
How can I detect this programatically in the code?
Thanks,
ming


You need to find out if it is open, rather than if it simply exists, don't
you? If you put this in a module:

Public Function IsFormLoaded(strName As String)
IsFormLoaded = (SysCmd(acSysCmdGetObjectState, acForm, strName) <> 0)
End Function

You can then write:

If IsFormLoaded("FormA") Then
' Do your stuff here
Else
MsgBox "FormA isn't open"
End If
Nov 13 '05 #2
"swingingming" <mi******@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
If Form A opens Form B with a filter set based a value on Form A. Then
I closed Form A, in navigating Form B, I got some error says Access can
not find Form A.
How can I detect this programatically in the code?
Thanks,
ming


You need to find out if it is open, rather than if it simply exists, don't
you? If you put this in a module:

Public Function IsFormLoaded(strName As String)
IsFormLoaded = (SysCmd(acSysCmdGetObjectState, acForm, strName) <> 0)
End Function

You can then write:

If IsFormLoaded("FormA") Then
' Do your stuff here
Else
MsgBox "FormA isn't open"
End If
Nov 13 '05 #3
Thanks, Justin. It works.
I added the function to my utility collections already.
Ming

Nov 13 '05 #4
Thanks, Justin. It works.
I added the function to my utility collections already.
Ming

Nov 13 '05 #5

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

Similar topics

1
by: Display Name | last post by:
the customer I'm developing a site for uses a canned form-parsing page that allows her to have an email subscription opt-in page add emails to a list she can manage using a link that you point your...
1
by: kyma via .NET 247 | last post by:
Hi, I haveto use VB to create a form that reads an exisiting XML fileand then allows updates via the VB form. My problem is that I was able to get VB to read a simple XML file(people.XML), but...
0
by: swingingming | last post by:
If Form A opens Form B with a filter set based a value on Form A. Then I closed Form A, in navigating Form B, I got some error says Access can not find Form A. How can I detect this...
10
by: Bande | last post by:
There is a program in VB , in which, there is a Form_QueryUnload( Cancel as Integer, UnloadMode as Integer) which would be called when the form is being closed. The UnloadMode is used to find...
13
by: PW | last post by:
Hi, This is bizarre. I've check and rechecked the spelling, cut and paste the name of the form (when trying to rename the form) and the control yet I still get a parameter prompt when the form...
10
by: sara | last post by:
Hi - I have been struggling with solution ideas for this now for almost 2 weeks, and have not been able to figure this out. I have a user who creates a Purchase Order (tblPOData). In some...
1
by: marcnz | last post by:
I have been charged of creating a coldfusion web site for our company. Our database has a ms sql 2005 backend and ms access frontend. Almost all tables are linked tables with the SQL database,...
5
by: keeps21 | last post by:
A little problem I've run into is the following. I have a script that allows a user to edit a story. I have an HTML form for title and main_text which gets it's values by pulling the selected...
10
by: dstorms | last post by:
Hi, I'm trying to create a button on a form that: 1. Takes the ComputerID from the form linked to Table 1, 2. Checks Table 2 for a matching ComputerID, and 3. Opens the query qryEditData, and...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.