Hi,
Attempts to find an answer to this have been unsuccessful thus far, so hopefully someone can assist here.
I have a form 'Lodgers' open and I open a form 'Payments' using the cmdAddNewPayment button. At the same time, I want to execute the cmdEditPayment sub when the form 'Payments' opens. So far I have:
I have tried different methods that I think would work, but don't achieve the desired result. I have made the sub in the form 'Payments' Public instead of Private and added a line of code under the DoCmd.OpenForm line, but to no avail.
Any help is appreciated.
Attempts to find an answer to this have been unsuccessful thus far, so hopefully someone can assist here.
I have a form 'Lodgers' open and I open a form 'Payments' using the cmdAddNewPayment button. At the same time, I want to execute the cmdEditPayment sub when the form 'Payments' opens. So far I have:
Code:
Private Sub cmdAddNewPayment_Click()
DoCmd.OpenForm "Payments", acNormal, , , acFormAdd, acDialog
End Sub
I have tried different methods that I think would work, but don't achieve the desired result. I have made the sub in the form 'Payments' Public instead of Private and added a line of code under the DoCmd.OpenForm line, but to no avail.
Code:
Public Sub cmdEditPayment_Click()
Me.Payment_Date.Enabled = True
Me.Payment_Date.Locked = False
Me.Amount.Enabled = True
Me.Amount.Locked = False
Me.Payment_Type.Enabled = True
Me.Payment_Type.Locked = False
Me.cmdEditPayment.Enabled = False
Me.cmdSavePayment.Enabled = True
End Sub
Any help is appreciated.