M
Mark Kubicki
(Please) could someone take a look at this SQL syntax error; I'm sure the
problem is obvious, but I'm not seeing it...
I'm getting the error (3061) "too few parameters; expected 1"
Many Thanks in advance,
Mark
------------------------------------
in the table tbeInstallationNotes
PrintInstallationNote = Yes/No
BaseInstallationNote = ,Yes/No
PrintOrder = Number
InstallationNote = Memo
Type = Text
on the form frmSpec
Type = Text
in the table OptInstallationNotes
Options = Memo
OptionNumber = AutoNumber
on the current form
combobox cmbInstallationNoteTitle is bound to the field OptionNumber in
the table OptInstallationNotes
OptionNumber = AutoNumber
-----------------------------------
Dim sSQL As String
Dim vPrintOrder As Variant
vPrintOrder = DMax("[PrintOrder]", "tbeInstallationNotes", "[Type] = '" &
Forms!frmSpec.Type & "'") + 1
sSQL = "INSERT INTO tbeInstallationNotes (PrintInstallationNote,
BaseInstallationNote, PrintOrder, InstallationNote, Type) " & _
"SELECT True, False, vPrintOrder, Options, '" & Forms!frmSpec.Type &
_
"' from OptInstallationNotes where OptionNumber = " &
[cmbInstallationNoteTitle] & ";"
CurrentDb.Execute (sSQL), dbFailOnError
--------------------------------
sSQL is returned as the string:
"INSERT INTO tbeInstallationNotes (PrintInstallationNote,
BaseInstallationNote, PrintOrder, InstallationNote, Type) SELECT True,
False, vPrintOrder, Options, 'TA' from OptInstallationNotes where
OptionNumber = 2;"
problem is obvious, but I'm not seeing it...
I'm getting the error (3061) "too few parameters; expected 1"
Many Thanks in advance,
Mark
------------------------------------
in the table tbeInstallationNotes
PrintInstallationNote = Yes/No
BaseInstallationNote = ,Yes/No
PrintOrder = Number
InstallationNote = Memo
Type = Text
on the form frmSpec
Type = Text
in the table OptInstallationNotes
Options = Memo
OptionNumber = AutoNumber
on the current form
combobox cmbInstallationNoteTitle is bound to the field OptionNumber in
the table OptInstallationNotes
OptionNumber = AutoNumber
-----------------------------------
Dim sSQL As String
Dim vPrintOrder As Variant
vPrintOrder = DMax("[PrintOrder]", "tbeInstallationNotes", "[Type] = '" &
Forms!frmSpec.Type & "'") + 1
sSQL = "INSERT INTO tbeInstallationNotes (PrintInstallationNote,
BaseInstallationNote, PrintOrder, InstallationNote, Type) " & _
"SELECT True, False, vPrintOrder, Options, '" & Forms!frmSpec.Type &
_
"' from OptInstallationNotes where OptionNumber = " &
[cmbInstallationNoteTitle] & ";"
CurrentDb.Execute (sSQL), dbFailOnError
--------------------------------
sSQL is returned as the string:
"INSERT INTO tbeInstallationNotes (PrintInstallationNote,
BaseInstallationNote, PrintOrder, InstallationNote, Type) SELECT True,
False, vPrintOrder, Options, 'TA' from OptInstallationNotes where
OptionNumber = 2;"