RE: Message appear while Access is thinking/working
- From: Dale Fye <dale.fye@xxxxxxxxxx>
- Date: Wed, 7 Jan 2009 07:20:00 -0800
I've also used a variant on this where I added a duration to the
OpenMyMessage subroutine. This allowed me to pass the routine a message and
a duration (# of seconds), which allowed me to pop up the message and display
for a certain number of seconds, then close it again.
--
HTH
Dale
email address is invalid
Please reply to newsgroup only.
"Dale Fye" wrote:
I've used both of the techniques that Allen mentioned, as well as just.
turning on the hourglass, but have found that when I'm executing a series of
queries, or am looping through a recordset (I try not to do this), that
displaying a form with a status bar is very useful to the user.
I have a form (frm_message) that contains 3 controls, a label, and two
rectangles, with the label sized to about 2" wide by 1/2" high, and put the
two rectangles right below the label. Both of the labels have their
backstyle set to normal, and the box_background has the backcolor set to
grey, while box_status has it's background set to some other color (whatever
you like).
I then have three subroutines in a code module that open the form, change
the status, and close the form.
Public Sub OpenMyMessage(Message As String, _
Optional DisplayStatus As Boolean = False)
Dim frm As Form
DoCmd.OpenForm "frm_Message", , , , , , Message
Set frm = Forms("frm_Message")
frm.InsideHeight = (0.875 + (0.25 * Abs(DisplayStatus))) * 1440
frm.InsideWidth = 2.5 * 1440
frm.lbl_MyMessage.Caption = Nz(Message, "unknown")
frm.box_Background.Visible = DisplayStatus
frm.box_Status.Visible = DisplayStatus
frm.box_Status.Width = 0
frm.Repaint
DoEvents
End Sub
Public Sub MyMessageStatus(PercentComplete As Single)
Dim frm As Form
Dim sngPercent as single
sngPercent = fnMax(fnMin(PercentComplete, 100), 0)
If CurrentProject.AllForms("frm_Message").IsLoaded Then
Set frm = Forms("frm_Message")
frm.box_Status.Width = frm.box_Background.Width * sngPercent
frm.Repaint
DoEvents
End If
End Sub
Public Sub CloseMyMessage()
If CurrentProject.AllForms("frm_Message").IsLoaded Then
DoCmd.Close acForm, "frm_Message"
End If
End Sub
This code also uses two other functions from my toolbox (fnMin and fnMax),
which ensure that I don't pass a number outside of the 0 to 100 % values to
the MyMessageStatus subroutine.
--
HTH
Dale
email address is invalid
Please reply to newsgroup only.
"tracktraining" wrote:
Hi All,
While data are being retrieved and records are being written to forms,
Access is “frozen” (aka thinking/working), during that time … do you know if
we can have a message “Updating employee information in progress…….”? After
the updating is completed, then another message appears "Employee information
updated".
Thanks,
Tracktraining
--
Learning
- References:
- Message appear while Access is thinking/working
- From: tracktraining
- RE: Message appear while Access is thinking/working
- From: Dale Fye
- Message appear while Access is thinking/working
- Prev by Date: RE: Message appear while Access is thinking/working
- Next by Date: Re: Decimal number with ListCount in the expression
- Previous by thread: RE: Message appear while Access is thinking/working
- Next by thread: Checking if form is a sub-form
- Index(es):
Relevant Pages
|