No null data entry

rhernand

Registered User.
Local time
Today, 01:12
Joined
Mar 28, 2003
Messages
96
I have a form for entering records. On some of the TEXT fields I want to update the table with the literal "Unknown" if nothing is entered. But I do not want to make this field's Default "Unknown". Where can I check for this?There is no tab control; the client can move thoughout the form with the mouse.

:confused:
 
I think you can use the Before Update event of the form to check for empty text fields, you can then set the values of the text fields to "Unknown" before the record gets saved.
 
I shall give it a whirl
 
Did Not Work

I put the following in the Form Before Update and it did not work. The record saved did not change: still has a blank in the fields. I also tried, = "".

Private Sub Form_BeforeUpdate(Cancel As Integer)
If [Forms]![frm_oil_sample_slip].test_no = Null Then
[Forms]![frm_oil_sample_slip].test_no = "Unknown"
ElseIf [Forms]![frm_oil_sample_slip].equipment = Null Then
[Forms]![frm_oil_sample_slip].equipment = "Unknown"
ElseIf [Forms]![frm_oil_sample_slip].manufctr = Null Then
[Forms]![frm_oil_sample_slip].manufctr = "Unknown"
ElseIf [Forms]![frm_oil_sample_slip].serial_no = Null Then
[Forms]![frm_oil_sample_slip].serial_no = "Unknown"
ElseIf [Forms]![frm_oil_sample_slip].epe_no = Null Then
[Forms]![frm_oil_sample_slip].epe_no = "Unknown"
ElseIf [Forms]![frm_oil_sample_slip].location = Null Then
[Forms]![frm_oil_sample_slip].location = "Unknown"
End If
End Sub


rhernand said:
I shall give it a whirl
 
try

if IsNull([Forms]![frm_oil_sample_slip].test_no) then
...
 
Argh.... Kodo beat me to it!
 
sorry my sha-lyn kin.. you beat me to plenty! :p
 

Users who are viewing this thread

Back
Top Bottom