473,398 Members | 2,125 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,398 software developers and data experts.

Identifying opend forms

Dear Folks:

Question #1:
I have not been able to find a method to acknowledge or indicate that a
form is open (not necessarily have the focus). Any ideas on how to
check if a particular form is open from VBA?

Question #2:
Is there anyway to trigger an event or DETECT that the Alt key (or any
other key like SHIFT or CTRL) has been pressed down while CLICKING on a
control on a form? This would be similar to other Window applications
where by holding down the Ctrl (Control) key while clicking modifies the
action of simply clicking without depressing the Ctrl key.
Thanks!
Greg Fierro

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
5 3634
On 23 Sep 2003 11:02:22 GMT, Greg F. <gr********@yahoo.com> wrote:

1: iterate over the Forms collection.

2: Check out the Keydown event.

-Tom.

Dear Folks:

Question #1:
I have not been able to find a method to acknowledge or indicate that a
form is open (not necessarily have the focus). Any ideas on how to
check if a particular form is open from VBA?

Question #2:
Is there anyway to trigger an event or DETECT that the Alt key (or any
other key like SHIFT or CTRL) has been pressed down while CLICKING on a
control on a form? This would be similar to other Window applications
where by holding down the Ctrl (Control) key while clicking modifies the
action of simply clicking without depressing the Ctrl key.
Thanks!
Greg Fierro

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 12 '05 #2
#1 this is a block of code I came across years ago.

Function FormisLoaded(anyForm As String) As Integer

On Error GoTo FormIsLoaded_Err

' Scan the open forms...
Dim I%
For I% = 0 To Forms.Count - 1
If (Forms(I%).FormName = anyForm) Then
FormisLoaded = True
Exit Function
End If
Next I%

FormisLoaded = False

Exit Function

FormIsLoaded_Err:
msgbox err
Exit Function

End Function
Nov 12 '05 #3
> Question #1:
I have not been able to find a method to acknowledge or indicate that a
form is open (not necessarily have the focus). Any ideas on how to
check if a particular form is open from VBA?
Hehe, just implemented this a few minutes ago! The IsLoaded function
is what you're looking for: it takes the name of a form (as string) as
a parameter and returns true if the form has been loaded and false
otherwise. Keep in mind hidden forms are still considered loaded (but
you could probably distinguish them by calling the visible property).
Question #2:
Is there anyway to trigger an event or DETECT that the Alt key (or any
other key like SHIFT or CTRL) has been pressed down while CLICKING on a
control on a form? This would be similar to other Window applications
where by holding down the Ctrl (Control) key while clicking modifies the
action of simply clicking without depressing the Ctrl key.


I don't remember off the top of my head, but I think there is a method
to check whether or not a key has been depressed. You could call this
function in the OnClick event of the desired controls.

Sorry I couldn't be more specific; I'm a VBA neophyte as well ;p
Nov 12 '05 #4
Dear Andante

I took a look at the list of internal functions in Access 2000 and
couldn't find the IsLoaded function. Could you give me a bit more info
of where you found this "IsLoaded" function?

Thanks!
Greg Fierro

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #5
Oops, my bad. IsLoaded is a sample function that was c/p'ed from the
sample Northwind database provided with Access. I took this for
granted that my predecessor pasted this code in a common module I
didn't see before. This code is as follows in Access 97. It should
work with 2000 as well, but you might have to c/p it from the 2000
Northwind; it is located in the "Utility Functions" module:

Function IsLoaded(ByVal strFormName As String) As Boolean
' Returns True if the specified form is open in Form view or
Datasheet view.

Const conObjStateClosed = 0
Const conDesignView = 0

If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
conObjStateClosed Then
If Forms(strFormName).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If
End Function
Nov 12 '05 #6

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

Similar topics

1
by: David | last post by:
I know that identifying the user IP address with HTTP_SERVER_VARS; is reliant on the browser agent but I have stumpled upon the following code which I have tried to understand but failed! ...
1
by: Mark | last post by:
Hi All, I have a problem with my database where people are leaving queries open. What I need to do is have some sort of timer that starts whenever a query is opened and then say after 2 minutes,...
3
by: Christopher Weaver | last post by:
I want to set a value in a specific field in the current row of a DataSet. This seems like the most basic thing to do but I can't find the syntax for identifying the current row. IOW, I can do...
1
by: prasannacse | last post by:
in the run time i want to close all the opend files if there is. i couldnt find which file is not closed. when i run the application frirst time it should delete a folder which folder contains some...
1
by: Veksi | last post by:
Hello, I am trying to create my own macro to working application dialog box. I find dialogbox of application on these code: Sub DMEU() 'How to find FindControl ID for FindControl 'and Execute...
2
by: Nicholas | last post by:
Hello, I'm new in Javascript and it seems I'm a bit stuck so if someone can help. The problem is 4th button / function. I dont know how to talk to the opend window, the thing with focus i wrote...
10
by: Frankie | last post by:
It appears that System.Random would provide an acceptable means through which to generate a unique value used to identify multiple/concurrent asynchronous tasks. The usage of the value under...
1
by: Tempalli | last post by:
CAN DATABASE OPEND FROM THE ACTIVE FOLDER PATH WITHOUT DEFINING SUCH LONG PATH. KINDLY HELP ME. ANANTH ;------------------------------------------------------------------------------- Dim...
3
by: Michael Powe | last post by:
Hello, Here is my problem: I have a site that uses urls of this format to submit forms: <a id="1_1_2_0" href="Javascript:if(validate)submitForm(...)">Submit</a> I'm just a third-party...
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: 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
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:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.