Insert into?

irade92

Registered User.
Local time
Today, 19:42
Joined
Dec 26, 2010
Messages
229
Hi
why this doesn't work
mATC_FULL = "escitaloptam tabl. 20 mk"
DoCmd.RunSQL "INSERT INTO tblXML_LEKOVI_KOM (GENERIKA_FULL) VALUES (" & mATC_FULL & ")"

field GENERIKA_FULL is text
 
...VALUES ('" & mATC_FULL & "')"
 
May want to look at my discussion for why and the CSql function.
 
why this doesn't work

It's very difficult to get the syntax right in these notorious INSERT INTO SQL Statements
A solution I promote is to divide and conquer, break your SQL Statement down into smaller elements and then reassemble it. I've noticed that a lot of coding relies on repeating patterns, and if you adopt/learn a pattern, save a sample of the pattern as I described on my website (very easy to do) then use the pattern again and again. This way you can reduce syntax errors a 100-fold. For more information about my solution and videos and samples that you can download, see my website here:- https://www.niftyaccess.com/insert-into-sql-statement/
 

Users who are viewing this thread

Back
Top Bottom