Hi,
Me again.
You need to put this code it two places, one on the after update event of the combo box, and the other on the On Current event of the form. Then I would suggest taking the value in the combo box as a variable instead of taking it right from the combo box in your select case statements.
Also, please make sure the combo box bound column is a string, as you indicate here. If it is a number, then you need to call Column(1).
Something like:
Private Sub Nummer_code_AfterUpdate()
'On Error Resume Next remove this line
Dim sValue As String
If IsNull(Me.Nummer_code) Or Me.Nummer_code = "" Then
Me.TT_terug = 0
Else
sValue = Me.Nummer_code.Column(1)
If sValue = "Onvolledig ingevuld" Then
TT_terug = 0
Else
TT_terug = -1
End If
End If
End Sub
Anywho, if you are only using the check box as an automated control, there is not really a need for it since this check can be done in subsequent queries. If you must have the check box on the form, and it is only to be used when it is automated, be sure to set it to Enabled = No, Locked = Yes.
Did that help?
mmcdonal
|