Reputation: 5
I am trying to write code for a data certification status combobox that will allow or not allow the user to change the status based on specific guidelines:
I assume I would use a Select statement where Case 1 = Raw (ID=1), Case 2 = Clean (ID=2), Case 3 = Certified (ID=3). The IDs 1, 2, and 3 are the ID values in the lookup table for the data certification status'. What I'm struggling with is how I set the "Before" value to compare to the "Current" value, when the user has already selected a different value.
Also, I'm using the "OnChange" event. But wondering if "BeforeUpdate" or "OnDirty" events would be better.
Any help would be greatly appreciated.
Upvotes: 0
Views: 63
Reputation: 26
use "BeforeUpdate" Event on combox
If Me.Combo3.OldValue = 1 And Me.Combo3.Value = 2 Then
Dim x
x = MsgBox("all necessary QA/QC has been done? ", vbYesNo)
If x = vbNo Then
MsgBox "any thing you want to write"
Cancel = True
End If
End If
Upvotes: 1