H
hootyeah
I am wanting to do the following to ensure that all relevant data is
collected:
1. Force users to input data into certain text boxes and combos
2. Where fields are left blank (due to some info not being known at
time of data entry) a null value is created so the record appears in a
query based on several tables. An example would be a record in the form
Timings where Activity and Date is known but the Time is not, and due
to the field being formatted for time I cant enter a value "unknown".
In this instance it is important that a save the record with Activity
and Date, and fill in Time value when this is known.
Should error checking be treated differently for text and combo boxes?
I have been partially successful in creating messages for blank text
boxes - but didnt work for combos. All I did was select Required at the
table and used the follwing code in the OnClick property of a save
button:
Private Sub CmdSave_Click()
Dim MyMsg As String
On Error GoTo saveerror
Me.Refresh
saveerror:
If Val(Err) = 3314 Then
MyMsg = "Please enter a value for these fields :-"
If Len(Me.Combo30 & "") = 0 Then MyMsg = MyMsg & Chr(13) &
"Client"
If Len(Me.Combo94 & "") = 0 Then MyMsg = MyMsg & Chr(13) &
"Job Status"
If Len(Me.[Job Name] & "") = 0 Then MyMsg = MyMsg & Chr(13)
& "Job Name"
If Len(Me.Combo96 & "") = 0 Then MyMsg = MyMsg & Chr(13) &
"Job Type"
MyMsg = MyMsg & Chr(13) & Chr(13) & "Or Press 'ESC' to undo."
MsgBox MyMsg, , "Values Required"
End If
Cheers in advance
collected:
1. Force users to input data into certain text boxes and combos
2. Where fields are left blank (due to some info not being known at
time of data entry) a null value is created so the record appears in a
query based on several tables. An example would be a record in the form
Timings where Activity and Date is known but the Time is not, and due
to the field being formatted for time I cant enter a value "unknown".
In this instance it is important that a save the record with Activity
and Date, and fill in Time value when this is known.
Should error checking be treated differently for text and combo boxes?
I have been partially successful in creating messages for blank text
boxes - but didnt work for combos. All I did was select Required at the
table and used the follwing code in the OnClick property of a save
button:
Private Sub CmdSave_Click()
Dim MyMsg As String
On Error GoTo saveerror
Me.Refresh
saveerror:
If Val(Err) = 3314 Then
MyMsg = "Please enter a value for these fields :-"
If Len(Me.Combo30 & "") = 0 Then MyMsg = MyMsg & Chr(13) &
"Client"
If Len(Me.Combo94 & "") = 0 Then MyMsg = MyMsg & Chr(13) &
"Job Status"
If Len(Me.[Job Name] & "") = 0 Then MyMsg = MyMsg & Chr(13)
& "Job Name"
If Len(Me.Combo96 & "") = 0 Then MyMsg = MyMsg & Chr(13) &
"Job Type"
MyMsg = MyMsg & Chr(13) & Chr(13) & "Or Press 'ESC' to undo."
MsgBox MyMsg, , "Values Required"
End If
Cheers in advance