P
PeterJ
I have never learnt VB so what I know is all through trial, error and luck
:¬) Please bear that in mind if you answer my question.
I have a form used by an administrator to book training courses. When he/she
submits the request the system checks to see if there are already others
booked on the course. If so, then another form opens showing the number of
places still available. If there are no previous bookings (i.e. this is the
very first) then I skip the form with the place count on it and go directly
to a bookings confirmation form.
I use the "on Open" property to decide whether to skip the second form or not.
Everything works absolutely fine but if the form is skipped then the message
"OpenForm action was cancelled" appears. How can I suppress this message? As
you can see below, I've tried "DoCmd.SetWarnings False" but to no avail.
My "onOpen" code is:
Private Sub Form_Open(Cancel As Integer)
DoCmd.SetWarnings False
If Me.Recordset.RecordCount = 0 Then
Cancel = True
DoCmd.OpenQuery "Add Booking Details to Table", acNormal, acEdit
DoEvents
DoCmd.OpenForm "Booking Confirmation Details"
End If
End Sub
Any help much appreciated
Peter
:¬) Please bear that in mind if you answer my question.
I have a form used by an administrator to book training courses. When he/she
submits the request the system checks to see if there are already others
booked on the course. If so, then another form opens showing the number of
places still available. If there are no previous bookings (i.e. this is the
very first) then I skip the form with the place count on it and go directly
to a bookings confirmation form.
I use the "on Open" property to decide whether to skip the second form or not.
Everything works absolutely fine but if the form is skipped then the message
"OpenForm action was cancelled" appears. How can I suppress this message? As
you can see below, I've tried "DoCmd.SetWarnings False" but to no avail.
My "onOpen" code is:
Private Sub Form_Open(Cancel As Integer)
DoCmd.SetWarnings False
If Me.Recordset.RecordCount = 0 Then
Cancel = True
DoCmd.OpenQuery "Add Booking Details to Table", acNormal, acEdit
DoEvents
DoCmd.OpenForm "Booking Confirmation Details"
End If
End Sub
Any help much appreciated
Peter