473,699 Members | 3,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to display a message on the screen while a process is going on?

489 Contributor
I don't know why I'm having problems with such a simple problem. I want to display a message on the screen while a process is going on then turn it off when process is complete. If it blinked while on that would be fine to.

Thanks for your help as always.
Feb 2 '11 #1
9 23913
pod
298 Contributor
this is what I do when I want to update the display while a function is running(looping )
this message can be dynamically written too, make certain though it is inside the loop

it is up to you to adapt this to your needs

Bonne chance!

Expand|Select|Wrap|Line Numbers
  1.     Do While Not rst.EOF        
  2.         Form_Main.MessageTextBox.Value = "message to display during the loop"
  3.        '-------------------------------
  4.        'the lines of code you requested
  5.         Form_Main.Refresh     ' this is the display call to be refresh
  6.         DoEvents              ' this is the request to the task manager ... I think :)
  7.        '-------------------------------
  8.         rst.MoveNext
  9.     Loop
  10.  
Feb 3 '11 #2
colintis
255 Contributor
Try make a form represent as the message box. When your process starts, it will open the form; Once the process is finish, the code will close the opened form.

Expand|Select|Wrap|Line Numbers
  1. 'Open the "loading form"
  2. DoCmd.OpenForm "<name of your form>", OpenArgs:="Update"
  3.  
  4. 'This allows the code to continue while the form is opened
  5. DoEvents
  6. <Do something while the form is open>
  7.  
  8. 'Once your processes are done, close the form
  9. DoCmd.Close acForm, "<name of your form>", acSaveNo
  10.  
Feb 4 '11 #3
NeoPa
32,569 Recognized Expert Moderator MVP
Tom,

I decided this was an important question that many people might benefit from knowing more about, so I wrote an article to cover it in some depth (Progress Indicator in Access). See if it helps you.
CD Tom:
I don't know why I'm having problems with such a simple problem.
As with most times people decide the problem should be simple before they understand the issues, this is not remotely a simple one. I can understand you may think it ought to be, in an ideal world possibly, but I expect you understand better now.
Feb 5 '11 #4
Lysander
344 Recognized Expert Contributor
I don't know whether this helps, but I have a function "MESS" that I use in all my databases. It is very easy to use and works well for me.

I have a small form, with all controls disabled, called fdlgMessage. It has one label on it called lblMessage. The form is set to be modal and pop-up.

NEVER OPEN THE FORM DIRECTLY, as there is now way to close it again:)

I then have the following routine in a global module
Expand|Select|Wrap|Line Numbers
  1. Sub MESS(varText As Variant)
  2.  
  3. '   Author Mark Fisher
  4. '   Description
  5. '   ???
  6. '
  7.     On Error GoTo Err_MESS
  8. If varText = "OFF" Or Len(varText & "") = 0 Then
  9.     DoCmd.Close acForm, "fdlgMessage"
  10.     DoCmd.Hourglass False
  11. Else
  12.     DoCmd.OpenForm "fdlgMessage"
  13.     Forms!fdlgMessage!lblMessage.Caption = vbCrLf & varText
  14.     DoEvents
  15. End If
  16.  
  17. Exit_MESS:
  18.     Exit Sub
  19. Err_MESS:
  20.     MsgBox Err.Description & " in MESS"
  21.     Resume Exit_MESS
  22. End Sub
  23.  

Then anywhere in my code, if I want to display a message, whilst the code continues to run, I just type

MESS "Please display this message"

and then when the code has finished

MESS "Off" (This is critical else the only way to contine is to abort access)

For safety sake, I always have MESS "Off" in my error handler routine.

An example of it's use in code is as follows.

Expand|Select|Wrap|Line Numbers
  1.     setTableArray
  2.     For i = 0 To intTabCount
  3.         MESS "Setting " & arrTable(i, 0)
  4.         strSQL = "UPDATE " & arrTable(i, 0) & "  SET RecordConsistent = False;"
  5.         CurrentDb.Execute (strSQL), dbFailOnError
  6.     Next
  7.     MESS "OFF"
  8.  
  9.  
Feb 5 '11 #5
NeoPa
32,569 Recognized Expert Moderator MVP
Lysander:
NEVER OPEN THE FORM DIRECTLY, as there is now way to close it again:)
Try using Ctrl-F4. If Access Special Keys are disabled from your Startup dialog (but standard menus are still enabled) then try File \ Close. Otherwise, in such cases where everything is disabled in order to give higher control and security, put in a back-door within the form itself. Generally though, either of the first two methods should work.
Feb 6 '11 #6
CD Tom
489 Contributor
Works great, is there a way to make the message blink?
Feb 6 '11 #7
NeoPa
32,569 Recognized Expert Moderator MVP
There is no facility within a form to specify blinking as a colour property, but if you were happy to take the performance hit, you could include code in your timer procedure to alternate the colour between two for any particular message. I doubt the performance hit would be high, to be fair, and the concept is simple enough to implement. There is already a timer routine in the example in the article, that could be changed to allow code to do this for you.
Feb 6 '11 #8
CD Tom
489 Contributor
I have another idea, is there a way to put a processing indicator on the bottom of this form. What I mean by a processing indicator is a bar that moves across showing the percent complete? Just a thought.
Feb 7 '11 #9
NeoPa
32,569 Recognized Expert Moderator MVP
The Application.Sys Cmd() command was introduced in the linked article. It doesn't determine the percentage for you. You need to call the procedure each time you want it to update and specify the percentage that should be illustrated. This may be something to consider. I don't believe this shows as a control on a form though. It goes in the Status Bar. If that suits you, then you should consider it. There is more than adequate info on it if you look in the Help system for SysCmd().

Otherwise, designing your own control to show a percentage could easily be achieved by having a label of a certain width and filling it with the desired number of characters to illustrate the percentage desired. Any such solution would require you to determine that value for yourself though. No solution will be able to determine the progress for you automatically.
Feb 7 '11 #10

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

Similar topics

1
4184
by: Duppypog | last post by:
I have an asp.net page using a repeater control to display a dataset. When the dataset returned is null (no records matched the criteria) I want to display a message to the effect "No matching records found". I can't figure out how to do this. Any help is greatly appreciated, Lynnette
5
2348
by: GB | last post by:
Okay, here is what I am trying to do We have a dialog of windows that collects information for generation of a dynamic HTML report. The last page in the wizard dialog accepts all report options (in XML format) and calls a business tier object in the pageLoad event, which creates the HTML report file. This file is then streamed to the client This process works well, and whilst we have tuned it to death it still takes between 1-5 seconds...
5
2196
by: Christian Ista | last post by:
Hello, I have a form with 5 textbox for each one a RequiredFieldValidator I show (*) if the field is missing when I post the form. I'd like when a least one of theses RequiredFieldValidator fired display an another message (other then ErrorMessage). Is there a way to do that ? Thanks,
3
1882
by: David Allison | last post by:
I have written a Login page which initializes a session. I am trying to display a message to the user letting them know that the session is intializing. I would ideally like to load a page that displays while the query is running. Any ideas on how to accomplish this? I have tried to add webforms and user their page load events to launch my code but that does not work. From...
1
8496
by: prabhunew2005 | last post by:
hi all I need to display the message balloon alerting the user about CAPS LOCK key is on when they entering value in password text field. I don't know how to display the message balloon in web pages using javascript coding. Please it's very urgent. Help me.
2
2335
by: anoop | last post by:
Hello, I want to display message from .aspx.vb code behind file. I want to display data from SQL DataReader in the Message. what should I do. Thank you
1
1999
by: todashah | last post by:
Hi ! Guys, I have no idea about How to Display Message Box on Screen while using Asp.net with C# ? Help Me. Thanks in advance...
10
32845
by: Leo sajjad | last post by:
Dear All, I am looking for code to display message box in c sharp language and guide line if any other requirement regarding to display message i mean to say that any class or namespeacing is required. Thanks Sajjad Ali
21
11122
by: mukeshrasm | last post by:
Hi I am deleting records from database using checkbox. means only that record will be deleted from database which are selected in checkbox. and before deleting record I am displaying a message "Are you sure to delete the selected records" using javascript.and when user clicks OK, record is deleted. Here in message I want it should like "Are you sure to delete 5 records" if user selects 5 records. So how can I do this using javascript. ...
9
11506
ullevi83
by: ullevi83 | last post by:
Guys, First post on Byte, so hello all! I was wondering if I could pick somones brain regarding what I hoped would be an easy message display function, unfortunately it is causing me a lot of frustration. I am looking to display an alert box with a custom message depending on what textfield a user clicks on. For example, if I had a simple form with the following:
0
8704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9187
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9053
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8936
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8894
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7776
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5879
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3071
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 we have to send another system
2
2360
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.