I have a split form where if the user double clicks on any field in a particular record row, it opens a form which lets them edit the record.
The below is my VBA. Is there any way to just write the code once and have it be shared by multiple control_DblClick events?
The below is my VBA. Is there any way to just write the code once and have it be shared by multiple control_DblClick events?
Code:
Private Sub FirstName_DblClick(Cancel As Integer)
DoCmd.OpenForm "CustomerDetail", acNormal, , "[CustomerID]=" & Me.CustomerID, , acDialog
End Sub
Private Sub LastName_DblClick(Cancel As Integer)
DoCmd.OpenForm "CustomerDetail", acNormal, , "[CustomerID]=" & Me.CustomerID, , acDialog
End Sub
Private Sub Email_DblClick(Cancel As Integer)
DoCmd.OpenForm "CustomerDetail", acNormal, , "[CustomerID]=" & Me.CustomerID, , acDialog
End Sub
Private Sub PhoneNumber_DblClick(Cancel As Integer)
DoCmd.OpenForm "CustomerDetail", acNormal, , "[CustomerID]=" & Me.CustomerID, , acDialog
End Sub
Private Sub CustomerType_DblClick(Cancel As Integer)
DoCmd.OpenForm "CustomerDetail", acNormal, , "[CustomerID]=" & Me.CustomerID, , acDialog
End Sub