T
Tony Williams
I have a form that when it opens asks the user if they have performed a task
before they continue. If they answer "No" to the message box then the
current form should close and a new form opens. I have used this code but it
the first form doesn't close and the new one doesn't open. I thought this
was a simple action but I can't see what I'm doing wrong? Can anyone help?
Thanks
Tony
Private Sub Form_Open(Cancel As Integer)
Dim stformname As String
stformname = "frmeurovalue"
DoCmd.Restore
If MsgBox("Have you updated the Euro Value table for this quarter?",
vbYesNo, "Euro Update?") = No Then
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm stformname, acNormal
End If
End Sub
before they continue. If they answer "No" to the message box then the
current form should close and a new form opens. I have used this code but it
the first form doesn't close and the new one doesn't open. I thought this
was a simple action but I can't see what I'm doing wrong? Can anyone help?
Thanks
Tony
Private Sub Form_Open(Cancel As Integer)
Dim stformname As String
stformname = "frmeurovalue"
DoCmd.Restore
If MsgBox("Have you updated the Euro Value table for this quarter?",
vbYesNo, "Euro Update?") = No Then
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm stformname, acNormal
End If
End Sub