Sorry but no further progress even doing both form Update and seperatly does not seem to work.
Code:
Private Sub Form_Current()
If lstTUI = "Intern" Then
txtNUIT.Visible = False
lstNUIT.Visible = True
ElseIf lstTUI = "Extern" Then
txtNUIT.Visible = True
lstNUIT.Visible = False
End If
End Sub
Private Sub lstTUI__lstTUI_AfterUpdate()
If lstTUI = "Intern" Then
txtNUIT.Visible = False
lstNUIT.Visible = True
ElseIf lstTUI = "Extern" Then
txtNUIT.Visible = True
lstNUIT.Visible = False
End If
End Sub
Screenshot:
Edit the Problem is Solved:
Code:
Private Sub Form_Load()
If lstTUI__lstTUI.Value = "Intern" Then
lstNUIT.Visible = True
txtNUIT.Visible = False
txtNUIT.DefaultValue = vbNullString
Else
lstNUIT.Visible = False
txtNUIT.Visible = True
lstNUIT.DefaultValue = vbNullString
End If
If txtstatus.Value = "Uitgeleend" Then
lstTUI__lstTUI.Enabled = False
lstNUIT.Enabled = False
txtNUIT.Enabled = False
Datum.Enabled = False
Knop76.Enabled = False
Knop83.Enabled = True
Else
txtNUIT.Enabled = True
Datum.Enabled = True
Knop76.Enabled = True
Knop83.Enabled = False
txtuitlener.Enabled = False
txtuitlener.DefaultValue = vbNullString
txtuitgeleendtot.Enabled = False
txtuitgeleendtot.DefaultValue = vbNullString
End If
End Sub
Private Sub lstTUI__lstTUI_AfterUpdate()
If lstTUI__lstTUI.Value = "Intern" Then
lstNUIT.Visible = True
txtNUIT.Visible = False
txtNUIT.DefaultValue = vbNullString
Else
lstNUIT.Visible = False
txtNUIT.Visible = True
lstNUIT.DefaultValue = vbNullString
End If
End Sub