R
Russ
You gave me some advice a few days ago about control Null values and
so forth. (See GoToControl macro action) Here is the code you
supplied:
All was well, until I changed the Control Source property of one of
the combo box controls. Instead of it being Area, I changed it to
AreaID so the form would save the correct data. Then when I run the
form and insert a new record, I fill in the Area control via the combo
box and when I attempt to leave the form the code pops the message box
up telling me that AreaID control does not have a value. So, in the
code I changed the line:
As a result of that change, the Debug/Compile responds with: "Method
or Data Member not found".
How am I screwing up? Isn't the control source property what the code
(Me.AreaID) is looking for?
so forth. (See GoToControl macro action) Here is the code you
supplied:
In the form's Before Update event:
If IsNull(Me.Control_1) Then
MsgBox "Control_1 needs a value"
Me.Control_1.SetFocus
Cancel = True
ElseIf IsNull(Me.Control_2) Then
MsgBox "Control_2 needs a value"
Me.Control_2.SetFocus
Cancel = True
ElseIf IsNull(Me.Control_3) Then
MsgBox "Control_3 needs a value"
Me.Control_3.SetFocus
Cancel = True
End If
All was well, until I changed the Control Source property of one of
the combo box controls. Instead of it being Area, I changed it to
AreaID so the form would save the correct data. Then when I run the
form and insert a new record, I fill in the Area control via the combo
box and when I attempt to leave the form the code pops the message box
up telling me that AreaID control does not have a value. So, in the
code I changed the line:
IsNull(Me.Area) Then to
If IsNull(Me.AreaID) Then
As a result of that change, the Debug/Compile responds with: "Method
or Data Member not found".
How am I screwing up? Isn't the control source property what the code
(Me.AreaID) is looking for?