M
Mike
I have a combo box on my form. Its default value is not set. The combo is to
select text values to be inserted into a text field "AccountID" of table
"Payments".
When the combo is updated the following code runs:
Private Sub MyCombo_AfterUpdate()
Me.MyCombo.DefaultValue = Me.MyCombo
End Sub
The above code works fine. But....
On the form there is also a check box. When it is checked the following code
runs:
Private Sub MyCheckBox_AfterUpdate()
If Me.MyCheckBox = True Then
Me.MyCombo.Value = Me.MyCombo.DefaultValue
End If
End Sub
The code works fine starting from the second enetered record.
On the first record (when the default value of the combo is supposed to be
Null) I get runtime error 3315 "Field 'tblPayments.AccountID' cannot be a
zero-length string."
Thank you in advance for any help!
select text values to be inserted into a text field "AccountID" of table
"Payments".
When the combo is updated the following code runs:
Private Sub MyCombo_AfterUpdate()
Me.MyCombo.DefaultValue = Me.MyCombo
End Sub
The above code works fine. But....
On the form there is also a check box. When it is checked the following code
runs:
Private Sub MyCheckBox_AfterUpdate()
If Me.MyCheckBox = True Then
Me.MyCombo.Value = Me.MyCombo.DefaultValue
End If
End Sub
The code works fine starting from the second enetered record.
On the first record (when the default value of the combo is supposed to be
Null) I get runtime error 3315 "Field 'tblPayments.AccountID' cannot be a
zero-length string."
Thank you in advance for any help!