473,480 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Wait for user to close form

2 New Member
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 in fields of the form (done)
* excute a private function stored with the form (???)
(performs updates to other fields in the form)
* have the module WAIT until the form is closed by the user (???)
* resume the module (???)

Here's a code snippet of what I have so far...

Expand|Select|Wrap|Line Numbers
  1.     Do While Not rsCustNum.EOF
  2.         DoCmd.OpenForm "frmInvoicesLookup"
  3.         With [Forms]![frmInvoicesLookup]
  4.             ![filterToEmail].Value = "True"
  5.             ![DateFrom].Value = Date - 8
  6.             ![DateTo].Value = Date
  7.             ![CustomerNumber].Value = rsCustNum!CustomerNumber
  8.         End With
  9. CustomerNumber
  10. ' ---
  11. '      need to set focus to the form in question,
  12. '      execute the private function,
  13. '      and wait for the form to close
  14. ' ---
  15.         rsCustNum.MoveNext
  16.  
How do I do what is marked as the comment in the above code?

For the 'execute private function' part I could setup code for the form's On Open event that checks for "True" in the filterToEmail field and then calls the private function in question... although I'd rather try to call it from the Module if at all possible.

It's the setting focus to the form and waiting for it to be closed parts that have me stopped.

Thanks!
Oct 12 '06 #1
2 3684
Tanis
143 New Member
A form won't close on it's own. It takes user intervention on their part, unless you have programmed it to do so after an event has finished.
Oct 13 '06 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
Is this what you're looking for?

Expand|Select|Wrap|Line Numbers
  1.  
  2.     Do While Not rsCustNum.EOF
  3.         DoCmd.OpenForm "frmInvoicesLookup"
  4.         With [Forms]![frmInvoicesLookup]
  5.             ![filterToEmail].Value = "True"
  6.             ![DateFrom].Value = Date - 8
  7.             ![DateTo].Value = Date
  8.             ![CustomerNumber].Value = rsCustNum!CustomerNumber
  9.         End With
  10.         DoCmd.Close acForm, "frmInvoicesLookup"
  11.  
  12.         rsCustNum.MoveNext
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
Oct 14 '06 #3

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

Similar topics

4
12864
by: GTi | last post by:
Hello... I have a page located in a frame. This page contains a form. When the user submit this form I want to popup a "Please Wait" window popup window The post may take some time for the...
4
4894
by: Aaron Fude | last post by:
Hi, I have report that takes about 5-10 seconds to generate depending on the load. I want to show the user a progress bar while it is being generated and when it's done, forward the browser to...
3
4603
by: John Dalberg | last post by:
Hi I have a form that opens a new window for the results. Because the results might take a few seconds due to server processing, I would like to display a message "please wait" in the new...
1
1251
by: Lisa | last post by:
I have a Perl script that's called as a CGI to handle the form submission from a browser, thru which a user from the web can up load an image file. I would like, when the user clicks the "Send...
1
4541
by: VMI | last post by:
How can I add a small "Please wait..." form to a child form so that when I minimize the child form, the "Please Wait..." form will also disappear? This form will be displayed when the child form is...
9
3314
by: John Walker | last post by:
Hi, I have a datagrid with a radiobutton template column, with AutoPostBack set to TRUE. When the user clicks on a radiobutton the application will PostBack, and in the PostBack there will be...
15
2555
by: Agnes | last post by:
As the user click 'save' , i want to show a little prompt' Record is saved" (for 1-2 secs) , then it will closed automically, In my previous vfp application, there is a function "wait window" ....
6
1295
by: Terry Olsen | last post by:
I wanted to do this "inline" and not use a timer. Is there a better way? Do zipError = UnzipFile(datPath & zipFileName, datPath, False) If zipError = "Success" Then Exit Do UpdateStatus("File...
3
14915
by: tylo | last post by:
Hello, I am using "Sub Main" to open many forms, one at a time. The problem is, there's no default built-in way of keeping Sub Main from going onto the next line of code while the user is supposed...
0
7041
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
6908
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
5337
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,...
1
4779
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
181
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.