Halt code until dialog closed

npsavidge

Registered User.
Local time
Today, 14:08
Joined
Oct 28, 2009
Messages
15
HI,

I have a subform in my access form that has details of client visits and their status'. If i change a status to rescheduled or cancelled, i want a dialog form to pop up to allow the user to select a reason for cancellation/reschedule. I have done the form and set it to modal, but the code after the form is shown, runs straight afterwards causing problems. Is there a way of stopping the code until this dialog form is closed?

TIA

Nathan.
 
can you post up your code so we can see what you have done so far?
 
*********** OPENING THE REASON FORM *********

If Me.txt_Activity_Status = "ReScheduled" Or Me.txt_Activity_Status = "Cancelled" Then
glbActivity_ForReason = Me.Booked_Activity_ID
DoCmd.OpenForm "frm_Cancellation_Reason", acNormal
End If

'*********** THIS JUST CAUSES A LOCKUP ********

If FormIsOpen("frm_Cancellation_Reason") = True Then
GoTo check_form
End If

'************ CODE TO HALT *********

If Me.txt_Activity_Status = "ReScheduled" Then
If MsgBox("Do you wish to create the new appointm
 
Sorry

I have a label Check_Form, before the if statement
 
Get rid of your code for If formIsOpen and just change this:

DoCmd.OpenForm "frm_Cancellation_Reason", acNormal

to this:

DoCmd.OpenForm "frm_Cancellation_Reason", View:=acNormal, WindowMode:=acDialog
 

Users who are viewing this thread

Back
Top Bottom