hi all,
i have a booking form which enables users to make a booking and when the Status becomes "completed" , PAY button becomes active which can be clicked in order to make a payment FOR THAT BOOKING only...
the problem: the code behind the payment form is:
Private Sub form_load()
DoCmd.GoToRecord , "", acNewRec
txtPaymentID.Locked = True
txtPaymentID.BackColor = &HECECEC 'light grey as hexadecimal number
cboMethPay.SetFocus
Me.cboBookingID = Forms("frmbooking")("txtbookingid") 'copies the booking ID from booking form
Me.txtAmount = Forms("frmbooking")("txtcost") 'copies cost
this is OK when the payment is made first time, however, when the user goes back to the booking form, the STATUS of booking is going to stay COMPLETED and PAY button is active, so when PAY is clicked, the payment form generates new Payment ID! it lets the users fill in the fields to make another payment but THANKFULLY, on SAVE, it says that it wil create duplicate values.
so how do i stop the PAYMENT form from generating new payment ID when the booking is already paid for?
i have a booking form which enables users to make a booking and when the Status becomes "completed" , PAY button becomes active which can be clicked in order to make a payment FOR THAT BOOKING only...
the problem: the code behind the payment form is:
Private Sub form_load()
DoCmd.GoToRecord , "", acNewRec
txtPaymentID.Locked = True
txtPaymentID.BackColor = &HECECEC 'light grey as hexadecimal number
cboMethPay.SetFocus
Me.cboBookingID = Forms("frmbooking")("txtbookingid") 'copies the booking ID from booking form
Me.txtAmount = Forms("frmbooking")("txtcost") 'copies cost
this is OK when the payment is made first time, however, when the user goes back to the booking form, the STATUS of booking is going to stay COMPLETED and PAY button is active, so when PAY is clicked, the payment form generates new Payment ID! it lets the users fill in the fields to make another payment but THANKFULLY, on SAVE, it says that it wil create duplicate values.
so how do i stop the PAYMENT form from generating new payment ID when the booking is already paid for?