I have these two snippets of codes. This gets executed when I try to update the database with my form. The access database fields days_booked is defined as number and accd_date is defined as date/time. When the txtDaysBooked.text is not empty then the field will be updated with its value but when it's empty the database field should also be blank (the same with mebADate). But this is not the case, even if the text fields are blank, the database fields get updated with some numbers. I tried this:
Else
adoRs!days_booked = ""
but I got a type mismatch error.
If Not (form.txtDaysBooked.Text = ""
Then
adoRs!days_booked = form.txtDaysBooked.Text
Else
adoRs!days_booked = Nothing
End If
If Not (form.mebADate.ClipText = ""
Then
adoRs!accd_date = form.mebADate.Text
Else
adoRs!accd_date = Nothing
End If
Any help will be greatly appreciated.
Else
adoRs!days_booked = ""
but I got a type mismatch error.
If Not (form.txtDaysBooked.Text = ""
adoRs!days_booked = form.txtDaysBooked.Text
Else
adoRs!days_booked = Nothing
End If
If Not (form.mebADate.ClipText = ""
adoRs!accd_date = form.mebADate.Text
Else
adoRs!accd_date = Nothing
End If
Any help will be greatly appreciated.