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

Is it possible to create a message box in a macro to display comments but not require

I have a database that runs 30 different queries in a macro, and in total the macro can take up to 6 hours to run. I typically just minimize the DB and work on something else but it would be nice to be able to know how far along the macro is at times. I created steps in the macro to display a message box after each query completes (level 2 complete, level 3 complete, etc.) but the message box requires me to click "OK" before the next query will run. What I want is a "message" to appear but not require me to take any action, just display which query just completed. I could simply maximize the DB and see the current message to know which query was the last to complete at any time. Is this possible?
Oct 17 '16 #1
3 786
ADezii
8,834 Expert 8TB
You can display some form of Progress in a Status Bar at the bottom of the Access Window either as a Progress Meter or Text Strings.
Oct 17 '16 #2
PhilOfWalton
1,430 Expert 1GB
I use this:-


Colours can be changed.

It works out how many Shares (Queries) there are to process, displays the name of the Share (Query) on the bottom line and number processed & percentage.

I find the standard Status bar at the bottom of the screen that ADezil mentioned rather insignificant.

Phil
Oct 18 '16 #3
jforbes
1,107 Expert 1GB
A Progress Meters might be exactly what you are looking for. Alternatively, I tend to use Access' Status Bar for messages that aren't significant enough to warrant a Message Box. Which might also be what you are looking for. Or maybe a combination of Both. ADezii has already pointed this out, but I thought I would include my experience. Both would use the SysCmd Method, unless you want to use Phil's Progress Dialog, which would be something else.

What I typically do for a long process is use the following function to put a message on the Status Bar:
Expand|Select|Wrap|Line Numbers
  1.     'setStatus
  2. Public Sub setStatus(ByRef sStatus As String)
  3.     ' Sets the Status Bar Text
  4.     If sStatus = "" Then
  5.         Call SysCmd(acSysCmdClearStatus)
  6.     Else
  7.         Call SysCmd(acSysCmdSetStatus, sStatus)
  8.         ' Commented out as it will not work unless there 
  9.         ' is a Form Named Main Menu in the Project
  10.         'If isLoaded("MainMenu") Then
  11.         '    Forms("MainMenu").txtSessionHistory.Value = Forms("MainMenu").txtSessionHistory.Value & vbCrLf & sStatus
  12.         'End If
  13.     End If
  14.     DoEvents
  15. End Sub
  16.  
  17.     'isLoaded
  18. Function isLoaded(ByRef sFormName As String) As Boolean
  19.     ' Determines if a Form is loaded
  20.     If Len(sFormName) > 0 Then
  21.         isLoaded = CurrentProject.AllForms(sFormName).isLoaded
  22.     End If
  23. End Function
Expand|Select|Wrap|Line Numbers
  1. An Example Call would be:
  2.    setStatus("Started Executing '" & sQueryName & "' at " & Now())
  3. To Clear the Status:
  4.    setStatus("")
It will update the Status Bar as well as collect all the status messages that have been displayed into a TextBox on the Main Menu, so that at anytime, the User can review the message history... in case they were getting coffee when something significant happened.

If you wanted to include a Progress Bar, I would create a function to handle the Progress Bar, and then create an additional function that sets both the Status and the Progress.
Oct 18 '16 #4

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

Similar topics

4
by: NewAlias | last post by:
How to display comments for each enum entry? 'Enum example with commnents commented Private Enum MyEnum YourName =1 ' Set this to get your real name YourAge=2 ' Set this to get your real age...
1
by: Simon | last post by:
How can I create a Macro in VB generated Word document. It would be nice to add a Button to to the Word Doc too...
0
by: BG | last post by:
Can anyone explain how to create a macro to send a report to a person/group by using the input values entered in a report query? I generate a report by inputting date and ID # and each report...
15
by: ewarts | last post by:
How can I create a macro that will take the results from a query and export to a formatted excel sheet?
1
by: Mike D | last post by:
Windows XP Access 2003 G'Day I am using the built in create object macro to save a query to file in an excel format. I have left the "Output File" field blank so that the user can specify...
5
by: Laetitia | last post by:
Hi All Please can anyone advise whether it is possible to display messages in the status bar. I have a number of update queries which will be run and need to find a way to identify which...
2
by: Lori Phillips | last post by:
I need to create a macro in Access that will have a 10% discount and can't figure it out.
3
by: Ron Mowry | last post by:
I am wanting to create a macro that will fill a specific field on a form and then go to the next record set. I have a blank field in the table that the form is pulling from. I want the user to be...
2
by: James Bowyer | last post by:
Not quite as daft as it seems (I know Macro's are VBA!). Is there any way to create a macro that can be sent to users to create a personal macro that then sits in their Quick Access Toolbar. Or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.