Solved

VBA:  How do I get Pop-Up Box to "OK" itself - and disappear without me sitting there to do it?

Posted on 2008-06-12
6
803 Views
Last Modified: 2013-11-27
MS-Access-2003:  VBA Module Coding - opearting via Macro :

I have an Array that runs and at the end it gives a Pop-Up Box that shows either an Error with Error # or it will show Completed with No Errors.    I have to sit there and hit 'OK' for the Macro to proceed to the next Module.

How can I "automate" that OK - so that the box will pop-up and after a few seconds will go ahead and "OK" itself disappear - so that the Macro get proceed further?

Please help,  thanks,  sincerely, Raj.
0
Comment
Question by:R B
6 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 21768723
If you don't intend to read the message why are you creating it?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 21768779
more work, but you can.
create your own message form with timer.
0
 
LVL 2

Accepted Solution

by:
366306 earned 500 total points
ID: 21769397
If you're wanting to know the errors but continue with the routine, you could have the error handler write the error into a table built for errors.

Hope that helps
On Error Goto errhandle
 
<your code here>
 
exit sub
errhandle:
currentdb.execute "INSERT INTO tblLog (ErrDescription, ErrNumber, ErrTime) VALUES ('" & err.description & "', " & err.number & ", now())"
resume next
end sub

Open in new window

0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:R B
ID: 21771505
I want the Table Built for Errors to go to a certain location:   P:Prod:Aud:
How do I tell it this?  

Also where do I insert the code above?

The error export commands occur in 4 export segments:

ErrorExportAUD:
Set qry = Nothing
Set dbn = Nothing
ERRID = ERRID Or 1
DoCmd.Hourglass False
For Each err In Errors
  MsgBox err.Number & vbCrLf & err.Description
Next
End Sub

ErrorExportBUD:
Set qry = Nothing
Set dbn = Nothing
ERRID = ERRID Or 2
DoCmd.Hourglass False
For Each err In Errors
  MsgBox err.Number & vbCrLf & err.Description
Next
End Sub

ErrorExportMID:
Set qry = Nothing
Set dbn = Nothing
ERRID = ERRID Or 3
DoCmd.Hourglass False
For Each err In Errors
  MsgBox err.Number & vbCrLf & err.Description
Next
End Sub

ErrorExportEND:
Set qry = Nothing
Set dbn = Nothing
ERRID = ERRID Or 4
DoCmd.Hourglass False
For Each err In Errors
  MsgBox err.Number & vbCrLf & err.Description
Next
End Sub

Thanking you for your timely help, sincerely, Raj.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21774509
0
 

Author Closing Comment

by:R B
ID: 31466520
Thank you very much for the coding.  It apply to the fix my module.
sincerely, Raj.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question