Strange Null problem

yhgtbfk

Registered User.
Local time
Today, 23:55
Joined
Aug 30, 2004
Messages
123
I am trying to use the runsql command and I am encountering a strange problem.

The following works:

DoCmd.RunSQL ("INSERT INTO financial VALUES ('" & clientNumber & "', " & txtFinancial & ", '" & firstname & "', '" & surname & "', '" & txtDate & "', '" & txtTime & "', '" & editdate & "', '" & edittime & "', Null, Null, Null, '12', 'Bob', 10)")

But when I change the Null to a textbox with a null in it, it wont work:

DoCmd.RunSQL ("INSERT INTO financial VALUES ('" & clientNumber & "', " & txtFinancial & ", '" & firstname & "', '" & surname & "', '" & txtDate & "', '" & txtTime & "', '" & editdate & "', '" & edittime & "', '" & txtacc & "', Null, Null, '12', 'Bob', 10)")

The textbox txtacc has a null value in it.

This is frustrating me beyond belief. Please help.

Thank you in advance
 
I'm not sure that the textbox has a null in it. It might contain a zero-length string. If so, your table properties for that field need to be changed to set the AllowZeroLengthString property to yes.
 

Users who are viewing this thread

Back
Top Bottom