|
-
Dec 20th, 2005, 03:02 AM
#1
Thread Starter
Junior Member
Access Form Status.
May I know how to write a code to check whether this form is already open?
-
Dec 20th, 2005, 03:57 AM
#2
Re: Access Form Status.
You may know 
Code:
on error resume next
strName=forms("formname").name
Err.Number will be 0 (strname will hold the form name) if the form is open. Otherwise it creates an error.
This is only one method to do this.
Last edited by Ecniv; Dec 20th, 2005 at 04:36 AM.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Dec 20th, 2005, 08:44 PM
#3
Thread Starter
Junior Member
Re: Access Form Status.
Got what you mean..
I want to include this method in my program that everytime when i click on the openform button, it will check whther the form is already open or not.
if it is open, show a msgbox("already open"), otherwise, just open the form.
using your method.. i will be able to track when the form is already open.
but if it is not open.. it keeps popping out error..which i dont know how to deal with it..
Sub check1()
Dim strname As String
On Error GoTo Err_Open
On Error Resume Next
strname = Forms("temp").Name
MsgBox ("open")
Err_Exit:
Exit Sub
Err_Open:
Resume Err_Exit
End Sub
could you enlighten me on that?
Last edited by spoonjy; Dec 20th, 2005 at 08:52 PM.
Reason: illustrating my codes
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|