I have a combobox that has just two choices "open" or "closed", if closed is chosen I want to require a different field, a text box (date), to be
entered.
The code I used is:
Private Sub opcl_BeforeUpdate(Cancel As Integer)
If opcl = "closed" Then
MsgBox "Please enter date closed", vbOKOnly
compdate.SetFocus
Cancel = True
End If
End Sub
However, this produces the following error message:
Run-Time error 2108
You must save the field before you execute the GoToControl action,
the GoTo mtehod, or the SetFocus method.
PS I am a newbie to access programming.
Thank you in advance for any help.