problem with empty fields

ray147

Registered User.
Local time
Today, 00:18
Joined
Dec 13, 2005
Messages
129
i wonder if anybody can give me a hand here...

i have an SQL insert query as follows:

DoCmd.RunSQL "INSERT INTO Despatches (" & _
"[SupplierRef], " & _
"[DespDate], " & _
"[TimeIn], " & _
"[TimeOut], " & _
"[QtyLoaded], " & _
"[Shift], " & _
"[DocRef], " & _
"[TrailerRef], " & _
"[SealRef], " & _
"[Comments], " & _
"[TeamLeader]) " & _
"VALUES ('" & Supplier & "'," & _
date1 & "," & _
time1 & "," & _
time2 & "," & _
DespQty_1 & ",'" & _
shift1 & "','" & _
docref_1 & "','" & _
trailer_1 & "','" & _
seal_1 & "','" & _
comments_1 & "','" & _
TeamLeader.Value & "');"

This is working fine as long as I input the values for all the fields...when some values are missing, I get the error that Access can't append the query due to validation rule violations...got no clue what to do !

plss help!:o
 
Have you checked to see if the default settings of the fields you are filling in and updating are set to required (no) or allow zero length (yes)???? might be the first step to identifying the problem.
 
hii,
thanks for your answer...so strange..i can't find these two properties...i'm totally sure i've seen these properties somewhere but they doesn't seem to be there..i have textboxes and combo boxes...when i go into the property list until the 'All' tab can't locate those..weird..

btw this is Access 2003 , dunno abt 2K, i will check tomorrow coz i'm working on 2K at my workplace.

any other suggestions welcome!
 
Check the properties of the fields in the tables, not on the form.
 
tnx..that was a very good point! solved most of the issues...however, still have probs with the date/time fields...when the value of these two fields is not entered, an error will crop up that I have invalid syntax in the INSERT statement..btw both fields hold time (short time).
 

Users who are viewing this thread

Back
Top Bottom