Private Sub AddButton_Click()
On Error GoTo Err_AddButton_Click
'disable other command buttons
Me.PrevButton.Enabled = False
Me.NextButton.Enabled = False
Me.ReceiptButton.Enabled = False
'Cancel filter - didn't make a difference
'Me.Filter = ""
'Me.FilterOn = False
'DoCmd.GoToRecord , , acNewRec
Form.Recordset.AddNew
jdwp_Payment = 2952 'just testing here
jdwp_Date = Date 'and here
Exit_AddButton_Click:
Exit Sub
Err_AddButton_Click:
MsgBox Err.Description
Resume Exit_AddButton_Click
End Sub
ASKER
lngNoBookings = DCount("*", "tJDWBookings", "jdwb_Event=" & lngEventID & " And jdwb_BookingID=" & lngBookingID & " and jdwb_Status=" & Chr(34) & strStatus & Chr(34))
If lngNoBookings > 0 Then
Dim stDocName As String
stDocName = "fJDWEventPay"
DoCmd.OpenForm stDocName, , , , , acDialog, lngBookingID 'pass Open Args
Else
MsgBox error
End If
ASKER
ASKER
ASKER
ASKER
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
I can't see the Openform command so where is that?
And where is the AddButton?
The issue here is that if you use acDialog to open the second form, then code will stop running in the calling form until the opened form is closed.