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.
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
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! -
Do While Not rst.EOF
-
Form_Main.MessageTextBox.Value = "message to display during the loop"
-
'-------------------------------
-
'the lines of code you requested
-
Form_Main.Refresh ' this is the display call to be refresh
-
DoEvents ' this is the request to the task manager ... I think :)
-
'-------------------------------
-
rst.MoveNext
-
Loop
-
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. - 'Open the "loading form"
-
DoCmd.OpenForm "<name of your form>", OpenArgs:="Update"
-
-
'This allows the code to continue while the form is opened
-
DoEvents
-
<Do something while the form is open>
-
-
'Once your processes are done, close the form
-
DoCmd.Close acForm, "<name of your form>", acSaveNo
-
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.
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 -
Sub MESS(varText As Variant)
-
-
' Author Mark Fisher
-
' Description
-
' ???
-
'
-
On Error GoTo Err_MESS
-
If varText = "OFF" Or Len(varText & "") = 0 Then
-
DoCmd.Close acForm, "fdlgMessage"
-
DoCmd.Hourglass False
-
Else
-
DoCmd.OpenForm "fdlgMessage"
-
Forms!fdlgMessage!lblMessage.Caption = vbCrLf & varText
-
DoEvents
-
End If
-
-
Exit_MESS:
-
Exit Sub
-
Err_MESS:
-
MsgBox Err.Description & " in MESS"
-
Resume Exit_MESS
-
End Sub
-
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. -
setTableArray
-
For i = 0 To intTabCount
-
MESS "Setting " & arrTable(i, 0)
-
strSQL = "UPDATE " & arrTable(i, 0) & " SET RecordConsistent = False;"
-
CurrentDb.Execute (strSQL), dbFailOnError
-
Next
-
MESS "OFF"
-
-
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.
Works great, is there a way to make the message blink?
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.
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.
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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: 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,...
|
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...
| |