RE: Message appear while Access is thinking/working

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • RE: Message appear while Access is thinking/working
    ... I have a form that contains 3 controls, a label, and two ... Optional DisplayStatus As Boolean = False) ... Dim frm As Form ... Public Sub MyMessageStatus ...
    (microsoft.public.access.formscoding)
  • RE: Message appear while Access is thinking/working
    ... sngPercent = fnMax, 0) ... I have a form that contains 3 controls, a label, and two ... Optional DisplayStatus As Boolean = False) ... Public Sub MyMessageStatus ...
    (microsoft.public.access.formscoding)
  • Err.Raise + Call Stack + UserForm
    ... its way back to the top-most subroutine. ... Public Sub Class_Initialize ... On Error GoTo ErrorHandler ... Dim lErrNum As Long ...
    (microsoft.public.word.vba.general)
  • Re: Concatenating control names
    ... Public Sub DooDad(Frm As Form, LabelNum As Integer, Msg As String) ... Dim oLabel As Label ...
    (microsoft.public.vb.general.discussion)
  • Re: Still filename problem
    ... Do I have to declare it in each module or just any module? ... > Public Sub foo() ... > Public Sub bar() ... this subroutine calls another subroutine where I use a similar ...
    (microsoft.public.excel.programming)