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

msgbox delay

158 100+
Right now i have the user press a button and a file is imported via vba. I would like a message box to pop up and tell the user to "Please Wait". How do i cause this "delay" until the import is complete?

Thanks for any advice!
Aug 8 '08 #1
5 4768
missinglinq
3,532 Expert 2GB
I don't think you can do this with a messagebox; you'll have to "roll your own."

Create a small form, making it look like a messagebox. Make it PopUp, set Border Style to either Dialog or None, strip all the native controls (divider line, nav buttons, Close Button, etc.) then use code like this in your button:

Expand|Select|Wrap|Line Numbers
  1. Private Sub ImportFile_Click()
  2.   DoCmd.OpenForm "YourPopUpFormName"
  3.   'Code here to import file
  4.   DoEvents
  5.   DoCmd.Close acForm, "YourPopUpFormName"
  6. End Sub
The DoEvents line should keep the form closing command from executing until the file has finished importing.

What kind of files are you importing that take enough time to import that it's noticable?

Linq ;0)>
Aug 8 '08 #2
Jollywg
158 100+
What kind of files are you importing that take enough time to import that it's noticable?

Linq ;0)>[/quote]


just one xls file about 13mb, it takes about 4 or 5 seconds to load. I just dont want the user clicking the button 1000 times. Could i use the doevents cmd in the load event method.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdSalesLookup_Click()
  2. msgBox "Please Wait"
  3. Doevents
  4.     DoCmd.TransferSpreadsheet , acSpreadsheetTypeExcel9, "MasterZip", "C:\MasterZip.xls", True
this may not be the exact code, but something similar to this?

Thanks!
Matt
Aug 12 '08 #3
missinglinq
3,532 Expert 2GB
No. As I said in my original post, if you want the "Please wait..." message to disappear on its own, when the form is finished being imported, you cannot use a messagebox! A messagebox can only be closed by the user clicking on its appropriate button. In order to do what you want, you'll have to create a small form, following the instructions I gave you, to mimic a messagebox.

To be honest, though, if all you're talking about is 4-5 seconds for this file to import, a messagebox is all I'd fool around with. It will tell them what's going on, and by the time they read your message and click the OK button, the file will probably be through loading. It would be a different story if you were talking about 30-60 seconds or longer.

Linq ;0)>
Aug 12 '08 #4
Jollywg
158 100+
I don't think you can do this with a messagebox; you'll have to "roll your own."

Create a small form, making it look like a messagebox. Make it PopUp, set Border Style to either Dialog or None, strip all the native controls (divider line, nav buttons, Close Button, etc.) then use code like this in your button:

Expand|Select|Wrap|Line Numbers
  1. Private Sub ImportFile_Click()
  2.   DoCmd.OpenForm "YourPopUpFormName"
  3.   'Code here to import file
  4.   DoEvents
  5.   DoCmd.Close acForm, "YourPopUpFormName"
  6. End Sub
The DoEvents line should keep the form closing command from executing until the file has finished importing.

What kind of files are you importing that take enough time to import that it's noticable?

Linq ;0)>

How do you strip off the close min, max buttons and the record navigator in 2003?
Aug 12 '08 #5
How do you strip off the close min, max buttons and the record navigator in 2003?
In the properties box for any form, there are yes/no and other choices for each of the form's properties, including those you named. Be sure to click the "All" tab to see all choices. Success.
Oct 13 '08 #6

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

Similar topics

14
by: Des L. Davis | last post by:
System: Dell PowerEdge Server with 3 GB RAM, 2.4 GHz Celeron Software: Microsoft SQL Server 2000 Enterprise running on Windows 2003 Server Software: Microsoft SQL Server 2000 Enterprise running on...
2
by: amos_s12 | last post by:
Hello everybody Is there a possibility to make a delay between two sql statements, namely one sql statement is performed, then there is a delay of some seconds and then rhe next statement is...
6
by: lucifer | last post by:
hi i need to insert delay in my program what function should i use the old delay is not supported by the VC6
20
by: Doug Thews | last post by:
I ran into an interesting re-pain delay after calling the Abort() method on a thread, but it only happens the very first time I call it. Every time afterward, there is no delay. I've got a...
11
by: Maheshkumar.R | last post by:
Hi groups, How i can introduce some milliseconds delay in application. How i can do achieve this... let me clearly say... (1) I'm displaying slices of medical images. For framerate - for...
7
by: mfeingold | last post by:
I am working on a system, which among other things includes a server and a ..net control sitting in an html page and connected to the server. I ran into a couple of problems, you guys might have...
4
by: Jeremy S | last post by:
I have written an ASP.NET application that performs very well. I make heavy use of the Cache and otherwise minimize the number of round trips to to the db. I couldn't be happier with the...
4
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I make a 10 second delay? ----------------------------------------------------------------------- There...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.