SQL simple error

swarv

Registered User.
Local time
Today, 15:00
Joined
Dec 2, 2008
Messages
196
Hi all,

I have the code below. Access asks me to type in a value for reasonwhy when it should just place the value for reasonwhy in the database

reasonwhy is called earlier with:
dim reasonwhy as string
reasonwhy = text30.text


Thanks


Code:
SQLText = "INSERT INTO absent ([start_date], [end_date], [days], [reason], [name]) SELECT  " & totalstartdate & ", " & totalenddate & ", " & TotalBusinessDays & ", " & reasonwhy & ", [Text18]"
 
I'd say you've just not delimited your concatenated text to be inserted.
(Though I'm also rather sceptical about the trailing [Text18] in your query.)

For that matter - your date values haven't been delimited either. :-s
Do you do that in the variables?
 
Thanks Tony (but that was me done lol ;-)
 
cheers for your help. good points noted and I think i have it working now. cheers
 

Users who are viewing this thread

Back
Top Bottom