Please wait message

G

Guest

I have found instructions how to create a macro to launch a 'Please wait . .
..' message when opening a form, query, etc. Works nice.

I am lost how to get it to work with VBA when not simply opening a form,
query, etc. To the point: my main form contains a combo box that selects a
record. I want the user to see the message while its moving to the newly
selected record.

My afterupdate code in the combo box is:
' Find the record that matches the control.
Dim Rs As Object
Set Rs = Me.Recordset.Clone
Rs.FindFirst "[ClientID] = '" & Me![cboClient] & "'"
If Not Rs.EOF Then Me.Bookmark = Rs.Bookmark

I insert the run command first and it runs -- and closes. Meanwhile, the
new record is not viewed yet. What can I do to display the please wait
message once new record is selected until that new record is viewed.

Thanks.
 
G

Guest

Call something like this..where lbl333 is your message (you can give it a
BackColor of light red). This displayed for 2 seconds.

Private Sub Waiter()
Dim EndTime As Date
lbl333.Visible = True
EndTime = DateAdd("s", 2, Now())
While EndTime >= Now()
Wend
lbl333.Visible = False
End Sub

HTH - Bob
 
G

Guest

That's a fixed time, right? What I need is, ala the query or form open, for
the message to be visible UNTIL the new record is retrieved.

How would that work?

Thanks.

Bob Barnes said:
Call something like this..where lbl333 is your message (you can give it a
BackColor of light red). This displayed for 2 seconds.

Private Sub Waiter()
Dim EndTime As Date
lbl333.Visible = True
EndTime = DateAdd("s", 2, Now())
While EndTime >= Now()
Wend
lbl333.Visible = False
End Sub

HTH - Bob

redFred said:
I have found instructions how to create a macro to launch a 'Please wait . .
.' message when opening a form, query, etc. Works nice.

I am lost how to get it to work with VBA when not simply opening a form,
query, etc. To the point: my main form contains a combo box that selects a
record. I want the user to see the message while its moving to the newly
selected record.

My afterupdate code in the combo box is:
' Find the record that matches the control.
Dim Rs As Object
Set Rs = Me.Recordset.Clone
Rs.FindFirst "[ClientID] = '" & Me![cboClient] & "'"
If Not Rs.EOF Then Me.Bookmark = Rs.Bookmark

I insert the run command first and it runs -- and closes. Meanwhile, the
new record is not viewed yet. What can I do to display the please wait
message once new record is selected until that new record is viewed.

Thanks.
 
G

Guest

You can leave the lbl333.Visible = True before the code running your Query.
After that code, add lbl333.Visible = False. You may have to test to see if
you need a "time delay" until the record displays..then assign those seconds.

redFred said:
That's a fixed time, right? What I need is, ala the query or form open, for
the message to be visible UNTIL the new record is retrieved.

How would that work?

Thanks.

Bob Barnes said:
Call something like this..where lbl333 is your message (you can give it a
BackColor of light red). This displayed for 2 seconds.

Private Sub Waiter()
Dim EndTime As Date
lbl333.Visible = True
EndTime = DateAdd("s", 2, Now())
While EndTime >= Now()
Wend
lbl333.Visible = False
End Sub

HTH - Bob

redFred said:
I have found instructions how to create a macro to launch a 'Please wait . .
.' message when opening a form, query, etc. Works nice.

I am lost how to get it to work with VBA when not simply opening a form,
query, etc. To the point: my main form contains a combo box that selects a
record. I want the user to see the message while its moving to the newly
selected record.

My afterupdate code in the combo box is:
' Find the record that matches the control.
Dim Rs As Object
Set Rs = Me.Recordset.Clone
Rs.FindFirst "[ClientID] = '" & Me![cboClient] & "'"
If Not Rs.EOF Then Me.Bookmark = Rs.Bookmark

I insert the run command first and it runs -- and closes. Meanwhile, the
new record is not viewed yet. What can I do to display the please wait
message once new record is selected until that new record is viewed.

Thanks.
 
G

Guest

If I base it on running the query I might as well use the macro without the
time issue.

What I am hoping is learning how to run it from VBA while the record is
being retrieved. I am unable to do that with a macro...at least I cannot see
how to.

Bob Barnes said:
You can leave the lbl333.Visible = True before the code running your Query.
After that code, add lbl333.Visible = False. You may have to test to see if
you need a "time delay" until the record displays..then assign those seconds.

redFred said:
That's a fixed time, right? What I need is, ala the query or form open, for
the message to be visible UNTIL the new record is retrieved.

How would that work?

Thanks.

Bob Barnes said:
Call something like this..where lbl333 is your message (you can give it a
BackColor of light red). This displayed for 2 seconds.

Private Sub Waiter()
Dim EndTime As Date
lbl333.Visible = True
EndTime = DateAdd("s", 2, Now())
While EndTime >= Now()
Wend
lbl333.Visible = False
End Sub

HTH - Bob

:

I have found instructions how to create a macro to launch a 'Please wait . .
.' message when opening a form, query, etc. Works nice.

I am lost how to get it to work with VBA when not simply opening a form,
query, etc. To the point: my main form contains a combo box that selects a
record. I want the user to see the message while its moving to the newly
selected record.

My afterupdate code in the combo box is:
' Find the record that matches the control.
Dim Rs As Object
Set Rs = Me.Recordset.Clone
Rs.FindFirst "[ClientID] = '" & Me![cboClient] & "'"
If Not Rs.EOF Then Me.Bookmark = Rs.Bookmark

I insert the run command first and it runs -- and closes. Meanwhile, the
new record is not viewed yet. What can I do to display the please wait
message once new record is selected until that new record is viewed.

Thanks.
 
G

Guest

When I first started Programming Access in 1995, the Newsgroups recommended
using "Access Basic" (which changed to VBA) instead of using macros.

So, I learned Access Basic/ VBA...you're correct, VBA gives Control instead
of macros.

Try the code sample I listed.

Let me know.

redFred said:
If I base it on running the query I might as well use the macro without the
time issue.

What I am hoping is learning how to run it from VBA while the record is
being retrieved. I am unable to do that with a macro...at least I cannot see
how to.

Bob Barnes said:
You can leave the lbl333.Visible = True before the code running your Query.
After that code, add lbl333.Visible = False. You may have to test to see if
you need a "time delay" until the record displays..then assign those seconds.

redFred said:
That's a fixed time, right? What I need is, ala the query or form open, for
the message to be visible UNTIL the new record is retrieved.

How would that work?

Thanks.

:

Call something like this..where lbl333 is your message (you can give it a
BackColor of light red). This displayed for 2 seconds.

Private Sub Waiter()
Dim EndTime As Date
lbl333.Visible = True
EndTime = DateAdd("s", 2, Now())
While EndTime >= Now()
Wend
lbl333.Visible = False
End Sub

HTH - Bob

:

I have found instructions how to create a macro to launch a 'Please wait . .
.' message when opening a form, query, etc. Works nice.

I am lost how to get it to work with VBA when not simply opening a form,
query, etc. To the point: my main form contains a combo box that selects a
record. I want the user to see the message while its moving to the newly
selected record.

My afterupdate code in the combo box is:
' Find the record that matches the control.
Dim Rs As Object
Set Rs = Me.Recordset.Clone
Rs.FindFirst "[ClientID] = '" & Me![cboClient] & "'"
If Not Rs.EOF Then Me.Bookmark = Rs.Bookmark

I insert the run command first and it runs -- and closes. Meanwhile, the
new record is not viewed yet. What can I do to display the please wait
message once new record is selected until that new record is viewed.

Thanks.
 
G

Guest

Wow...I'm astounded I could not see the simplicity. This is the way to go.
Clean.

Thank you Bob!

Bob Barnes said:
You can leave the lbl333.Visible = True before the code running your Query.
After that code, add lbl333.Visible = False. You may have to test to see if
you need a "time delay" until the record displays..then assign those seconds.

redFred said:
That's a fixed time, right? What I need is, ala the query or form open, for
the message to be visible UNTIL the new record is retrieved.

How would that work?

Thanks.

Bob Barnes said:
Call something like this..where lbl333 is your message (you can give it a
BackColor of light red). This displayed for 2 seconds.

Private Sub Waiter()
Dim EndTime As Date
lbl333.Visible = True
EndTime = DateAdd("s", 2, Now())
While EndTime >= Now()
Wend
lbl333.Visible = False
End Sub

HTH - Bob

:

I have found instructions how to create a macro to launch a 'Please wait . .
.' message when opening a form, query, etc. Works nice.

I am lost how to get it to work with VBA when not simply opening a form,
query, etc. To the point: my main form contains a combo box that selects a
record. I want the user to see the message while its moving to the newly
selected record.

My afterupdate code in the combo box is:
' Find the record that matches the control.
Dim Rs As Object
Set Rs = Me.Recordset.Clone
Rs.FindFirst "[ClientID] = '" & Me![cboClient] & "'"
If Not Rs.EOF Then Me.Bookmark = Rs.Bookmark

I insert the run command first and it runs -- and closes. Meanwhile, the
new record is not viewed yet. What can I do to display the please wait
message once new record is selected until that new record is viewed.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top