simple syntax issue

M

Mark Kubicki

I'v blind this morning to an error in the syntax of my code.. if somone
would please take a look over my shoulder and redline the error...
many thanks in advance,
-mark

Type = text
PrintCatalogSheet = Yes/No
BaseCatalogSheet = Yes/No
CatalogSheetLink= Hyperlink
PrintOrder = Number
IsDetailSheet = Yes/No


Dim sSQL As String
sSQL = "INSERT INTO tbeAdditionalPages (Type, PrintCatalogSheet,
BaseCatalogSheet, CatalogSheetLink, PrintOrder, IsMountingDetail) " & _
"VALUES (" _
& " ' " & Forms![frmSpec].[Type] & "', " _
& true, _
& false, _
& "#'" & CatalogSheetLink & "',"_
& " vPrintOrder, " _
& false _
& ");"
CurrentDb().Execute sSQL, dbFailOnError
Forms![frmSpec].chldFixtureCuts.Requery
 
N

NuBie via AccessMonster.com

& "# ' " & CatalogSheetLink & "',"_


should it be?

& " ' # " & CatalogSheetLink & " ',"_


Mark said:
I'v blind this morning to an error in the syntax of my code.. if somone
would please take a look over my shoulder and redline the error...
many thanks in advance,
-mark

Type = text
PrintCatalogSheet = Yes/No
BaseCatalogSheet = Yes/No
CatalogSheetLink= Hyperlink
PrintOrder = Number
IsDetailSheet = Yes/No

Dim sSQL As String
sSQL = "INSERT INTO tbeAdditionalPages (Type, PrintCatalogSheet,
BaseCatalogSheet, CatalogSheetLink, PrintOrder, IsMountingDetail) " & _
"VALUES (" _
& " ' " & Forms![frmSpec].[Type] & "', " _
& true, _
& false, _
& "#'" & CatalogSheetLink & "',"_
& " vPrintOrder, " _
& false _
& ");"
CurrentDb().Execute sSQL, dbFailOnError
Forms![frmSpec].chldFixtureCuts.Requery
 
M

Mark Kubicki

now i'm getting this error
---------------------------
Too few parameters. Expected 1.
---------------------------
-mark

------------------------------------------------------------------------------------------------

NuBie via AccessMonster.com said:
& "# ' " & CatalogSheetLink & "',"_


should it be?

& " ' # " & CatalogSheetLink & " ',"_


Mark said:
I'v blind this morning to an error in the syntax of my code.. if somone
would please take a look over my shoulder and redline the error...
many thanks in advance,
-mark

Type = text
PrintCatalogSheet = Yes/No
BaseCatalogSheet = Yes/No
CatalogSheetLink= Hyperlink
PrintOrder = Number
IsDetailSheet = Yes/No

Dim sSQL As String
sSQL = "INSERT INTO tbeAdditionalPages (Type,
PrintCatalogSheet,
BaseCatalogSheet, CatalogSheetLink, PrintOrder, IsMountingDetail) " & _
"VALUES (" _
& " ' " & Forms![frmSpec].[Type] & "', " _
& true, _
& false, _
& "#'" & CatalogSheetLink & "',"_
& " vPrintOrder, " _
& false _
& ");"
CurrentDb().Execute sSQL, dbFailOnError
Forms![frmSpec].chldFixtureCuts.Requery
 
M

Mark Kubicki

got it... it should read:

sSQL = "INSERT INTO tbeAdditionalPages (type, printCatalogSheet,
BaseCatalogSheet, CatalogSheetLink, PrintOrder, IsMountingDetail) " _
& " Values(" _
& "'" & Forms!frmSpec.Type & " ', " _
& "true, " _
& "false, " _
& " ' # " & CatalogSheetLink & " ', " _
& vPrintOrder & ", " _
& "false" _
& ");"
CurrentDb().Execute sSQL, dbFailOnError



NuBie via AccessMonster.com said:
& "# ' " & CatalogSheetLink & "',"_


should it be?

& " ' # " & CatalogSheetLink & " ',"_


Mark said:
I'v blind this morning to an error in the syntax of my code.. if somone
would please take a look over my shoulder and redline the error...
many thanks in advance,
-mark

Type = text
PrintCatalogSheet = Yes/No
BaseCatalogSheet = Yes/No
CatalogSheetLink= Hyperlink
PrintOrder = Number
IsDetailSheet = Yes/No

Dim sSQL As String
sSQL = "INSERT INTO tbeAdditionalPages (Type,
PrintCatalogSheet,
BaseCatalogSheet, CatalogSheetLink, PrintOrder, IsMountingDetail) " & _
"VALUES (" _
& " ' " & Forms![frmSpec].[Type] & "', " _
& true, _
& false, _
& "#'" & CatalogSheetLink & "',"_
& " vPrintOrder, " _
& false _
& ");"
CurrentDb().Execute sSQL, dbFailOnError
Forms![frmSpec].chldFixtureCuts.Requery
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top