Sandy: Someone else may have a slicker way to deal with this, but when I
want to slow down the action I use a Pause Function (adapted from another
forum suggestion). Place this in a module:
Public Function Pause(PauseSeconds As Integer)
Dim Start
Start = Timer
Do While Timer < Start + PauseSeconds
DoEvents
Loop
End Function
Then place Pause 1, for example, in your code to pause for a second. Change
the pause amount to your liking.
To get the double quotes in the message, do this:
MsgBox "If this job is now complete check the " & Chr(34) & "Job Complete" &
Chr(34) & " check box", vbOKCancel
HTH
JoeD
> I have the following code attached to my form - works fine other than when
> the form is first opened. If the third "if" is true, the code runs before
[quoted text clipped - 26 lines]
> Sandy
>
Sandy,
when you put some code in the current event for the form, that code will run
while the form is open and loading and will have finished running by the
time the form has finished opening. You can't change this behaviour of
Access. If you want the user to only see the message after the form opens,
you will need to remove the message box from the current event. One
suggestion is to use a label instead of a message box. Make the label
visible or hide it depending on the values.
Another suggestion is to use a form to replace the message box.
Jeanette Cunningham
>I have the following code attached to my form - works fine other than when
>the form is first opened. If the third "if" is true, the code runs before
[quoted text clipped - 25 lines]
> Thanks
> Sandy
Linq Adams - 27 Jan 2008 04:50 GMT
Nice solution, Jeanette! I've seen this question come up a number of times
over the years without a successful resolution. And mimicing the messagebox
with a popup form also has the advantage of allowing much more in the way of
formatting than a real messagebox does!
Linq

Signature
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000/2003
Sandy - 31 Jan 2008 16:41 GMT
Hi Joe D, Jeanette, Linq,
Firstly, sorry for delay in coming back to you all, but I had problems with
my computer - fixed now though!
Sadly Joe, the pause function only delays the code from running and still
does not allow the form to open first.
However if I include the following at the top of my code-
Dim strFrmName As String
strFrmName = "Finalise Jobs"
DoCmd.OpenForm strFrmName
the form and the message box appear simultaneously which is a much better
result! Don't fully understand why it works (even when the form is already
open and a different record is selected) but it does.
Thanks for all your responses and I thought you might be interested in my
resolution.
Sandy
> Sandy,
> when you put some code in the current event for the form, that code will
[quoted text clipped - 37 lines]
>> Thanks
>> Sandy