G
Guest
I have a form which is unbound. The user selects a save button to write the
values to a record in a table which I handle in code with rst.addnew etc. I
want to check that all controls have data before the code is run. Tried the
following but it seems to ignore it?
Dim NullFlag As Boolean
NullFlag = False
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
If ctl.Value = Null Then
NullFlag = True
End If
End If
Next ctl
If NullFlag = True Then
Msg = "You must enter a value in ALL fields to be able to Post a
Transaction"
MsgBox Msg, vbCritical, "Data Entry Incomplete"
Can anyone help with this please?
Sue
values to a record in a table which I handle in code with rst.addnew etc. I
want to check that all controls have data before the code is run. Tried the
following but it seems to ignore it?
Dim NullFlag As Boolean
NullFlag = False
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
If ctl.Value = Null Then
NullFlag = True
End If
End If
Next ctl
If NullFlag = True Then
Msg = "You must enter a value in ALL fields to be able to Post a
Transaction"
MsgBox Msg, vbCritical, "Data Entry Incomplete"
Can anyone help with this please?
Sue