reddevil1
Registered User.
- Local time
- Today, 15:59
- Joined
- Nov 12, 2012
- Messages
- 92
Hi,
I am very new to VBA coding and would really appreciate any guidance you can give.
I have a Combo Box (MethodMoneyInOut) and if anything apart from "Cheque" is chosen, I want to lock and disable a control called "Cheque No".
But I do not want the new selection in MethodMoneyInOut to be accepted (I want to keep the previous selection).
I am very new to VBA coding and would really appreciate any guidance you can give.
I have a Combo Box (MethodMoneyInOut) and if anything apart from "Cheque" is chosen, I want to lock and disable a control called "Cheque No".
But I do not want the new selection in MethodMoneyInOut to be accepted (I want to keep the previous selection).
Code:
Private Sub MethodMoneyInOut_AfterUpdate()
If Not IsNull(Me.ChequeNo) Then
MsgBox "Please delete Cheque No. before changing this field"
Else
(does anything need to go in here, or can i leave it blank????)
End If
If MethodMoneyInOut <> "Cheque" Then
ChequeNo.BackColor = 12566463
ChequeNo.Locked = True
ChequeNo.Enabled = False
Else
ChequeNo.BackColor = 16777215
ChequeNo.Locked = False
ChequeNo.Enabled = True
End If
End Sub