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

Wait for DoCmd.OpenForm

48
I have a form with a button, launching (OnClick event) a Sub which contains
- DoCmd.OpenForm
- MsgBox

Is there a way to wait after the DoCmd.OpenForm till the form is closed again ?

Thx
Apr 7 '08 #1
7 16052
JustJim
407 Expert 256MB
I have a form with a button, launching (OnClick event) a Sub which contains
- DoCmd.OpenForm
- MsgBox

Is there a way to wait after the DoCmd.OpenForm till the form is closed again ?

Thx
Hi,
Not sure if I understand this one. Do you want the form to close automatically after a certain amount of time?

Explain a bit more and we'll see if we can help you.

Jim
Apr 7 '08 #2
wquatan
48
Hi,
Not sure if I understand this one. Do you want the form to close automatically after a certain amount of time?

Explain a bit more and we'll see if we can help you.

Jim
Hi,

When the button is clicked
- the OncLick events launches the sub
- in that sub, the docmd.openform is executed, the form opened
- next the MsgBox in the sub after the DoCmd.openform) is executed immedeatly

I am looking for a way to postpone the execution of the MsgBox till the form has been closed
Apr 7 '08 #3
missinglinq
3,532 Expert 2GB
You need to open the form in Dialog mode:

DoCmd.OpenForm "Your Form Name", , , , , acDialog

Linq ;0)>
Apr 7 '08 #4
wquatan
48
You need to open the form in Dialog mode:

DoCmd.OpenForm "Your Form Name", , , , , acDialog

Linq ;0)>
Thx

I itried that before, but doesn't work. The MsgBox still gets executed immedeatly.
The only difference I see : with acDialog the form is opened as a DataSheet.
Apr 7 '08 #5
missinglinq
3,532 Expert 2GB
For a form to be opened in Datasheet view, you have to have told Access to do this, in your DoCmd.OpenForm command! Using acDialog doesn't do this. And if you've done this, the acDialog argument won't delay the code for the messagebox from executing, because you can't open a form in both Datasheet and acDialog. If you have to
open this form in Datasheet view I'm afraid you're stuck!

If you didn't intentionally open the form in Datasheet view, post your code here for us to look at.

Linq ;0)>
Apr 7 '08 #6
wquatan
48
For a form to be opened in Datasheet view, you have to have told Access to do this, in your DoCmd.OpenForm command! Using acDialog doesn't do this. And if you've done this, the acDialog argument won't delay the code for the messagebox from executing, because you can't open a form in both Datasheet and acDialog. If you have to
open this form in Datasheet view I'm afraid you're stuck!

If you didn't intentionally open the form in Datasheet view, post your code here for us to look at.

Linq ;0)>
Hi,

The form I want to open is not a Datasheet when opened directly
I do not want to open as a Datasheet

The sub (initiated by clicking a button on another form) contains :

Private Sub EditEmailServices_Click()
DoCmd.OpenForm "Form1", acDialog
MsgBox "MAINBACK" --> gets executed immedeatly
End Sub
Apr 7 '08 #7
wquatan
48
Sorry !

Stupid me !
The number of "," wasn't correct !

Thanks for helping !
Apr 7 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: beowulfs | last post by:
Here's what I've got: I've got a form with combo boxes. you can select already existing company names or type in new ones. if you type in a new one, it prompts you to double click the combo...
3
by: Lyn | last post by:
Hi, I have a Search input form which collects from the user a person's name. I am using LIKE with a "%" suffix in the SQL so that the user does not have to type in the full name. When they hit...
15
by: Thelma Lubkin | last post by:
formA determines some_where and some_value and issues docmd.close ,Me docmd.openform "formB", , ,some_where, , ,some_value formB receives the correct some_where and some_value After...
2
by: Mike | last post by:
I am trying to open a search results form based on the input from a prompt form. I am using the following code: --- Begin Code --- Private Sub btnSearch_Click() 'Dim Variable and assign data...
9
by: keliie | last post by:
Hello (from Access novice), I'm building a switchboard form (using a Treeview object). The treeview is populated by two tables (tblSwitchboardParent and tblSwitchboardChild). Within...
2
by: hufnagel | last post by:
I have a module I'm building that kicks off with a button click. I need the module to do the following... * some various housekeeping stuff and data collection (done) * open a form (done) * fill...
2
by: rturpyn | last post by:
I want to simply open a form, I don't want to limit the records returned. I'm using the code.... DoCmd.OpenForm "frm_GSG_Access_Rights", acFormDS, , When I enter something in the where...
2
by: semutmerah | last post by:
hi.. my english maybe wrong.. but hope somebody can understand me :) I did created 3 forms. "MainForm" , "CalForm" , "WaitForm". On "MainForm", I did put a command button called "Run". ...
1
by: silen | last post by:
i am using Access2000. Currently i had a main form call "frmDownload" and sub form "fsubAdmmission". Under the fsubAdmmission, i do have another sub form "fsubHospital". Once i link my application to...
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
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?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.