G
ghost
Greeting,
I have a form for inputting data in table. In this form there is a button
for adding data and it has the following code:
Dim ctl As Control
For Each ctl In Controls
If TypeOf ctl Is TextBox Or ComboBox Then
If Len(Nz(ctl.Value)) = 0 Then
MsgBox "please enter data " & ctl.name
Exit For
End If
End If
Next ctl
This code is for checking all fields and make sure they are not empty. The
problem is when I miss a field , a msg box appears to warn and once click ok
all pervious data disappears and I have to fill fields again . is there any
solution for this problem?
I have a form for inputting data in table. In this form there is a button
for adding data and it has the following code:
Dim ctl As Control
For Each ctl In Controls
If TypeOf ctl Is TextBox Or ComboBox Then
If Len(Nz(ctl.Value)) = 0 Then
MsgBox "please enter data " & ctl.name
Exit For
End If
End If
Next ctl
This code is for checking all fields and make sure they are not empty. The
problem is when I miss a field , a msg box appears to warn and once click ok
all pervious data disappears and I have to fill fields again . is there any
solution for this problem?