473,406 Members | 2,867 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,406 software developers and data experts.

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

489 256MB
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

✓ answered by NeoPa

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.

9 23813
pod
298 100+
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 100+
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,556 Expert Mod 16PB
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 Expert 100+
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,556 Expert Mod 16PB
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 256MB
Works great, is there a way to make the message blink?
Feb 6 '11 #7
NeoPa
32,556 Expert Mod 16PB
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 256MB
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,556 Expert Mod 16PB
The Application.SysCmd() 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
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...
5
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...
5
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...
3
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...
1
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...
2
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
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
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...
21
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...
9
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...
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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,...
0
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...

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.