T
TeeSee
The following SQL compiles and runs as expected.
strSQL = "INSERT INTO tblMaterialMasterHistory ( ChngeDate,
SISitemCode,"
strSQL = strSQL & " OldDiscount )"
strSQL = strSQL & " SELECT Date()as ChngeDate,
tblMaterialMaster.SISItemCode,"
strSQL = strSQL & " tblMaterialMaster.Discount"
strSQL = strSQL & " FROM tblMaterialMaster"
strSQL = strSQL & " WHERE ((tblMaterialMaster.SISItemCode) Like "
& """" & strItem & """)"
Now when I try to introduce a stand alone variable which was
established thru an input box I get error code 3061 "too few
parameters" Expected 1
Dim sglDiscount as Single
strSQL = "INSERT INTO tblMaterialMasterHistory ( ChngeDate,
SISitemCode,"
strSQL = strSQL & " OldDiscount, NewDiscount)"
strSQL = strSQL & " SELECT Date()as ChngeDate,
tblMaterialMaster.SISItemCode,"
strSQL = strSQL & " tblMaterialMaster.Discount, 'sglDiscount' as
NewDiscount"
strSQL = strSQL & " FROM tblMaterialMaster"
strSQL = strSQL & " WHERE ((tblMaterialMaster.SISItemCode) Like "
& """" & strItem & """)"
The above compiles and steps thru the entire code with no error but
does NOT update NewDiscount. It must be in the syntax.
Any thoughts please?
strSQL = "INSERT INTO tblMaterialMasterHistory ( ChngeDate,
SISitemCode,"
strSQL = strSQL & " OldDiscount )"
strSQL = strSQL & " SELECT Date()as ChngeDate,
tblMaterialMaster.SISItemCode,"
strSQL = strSQL & " tblMaterialMaster.Discount"
strSQL = strSQL & " FROM tblMaterialMaster"
strSQL = strSQL & " WHERE ((tblMaterialMaster.SISItemCode) Like "
& """" & strItem & """)"
Now when I try to introduce a stand alone variable which was
established thru an input box I get error code 3061 "too few
parameters" Expected 1
Dim sglDiscount as Single
strSQL = "INSERT INTO tblMaterialMasterHistory ( ChngeDate,
SISitemCode,"
strSQL = strSQL & " OldDiscount, NewDiscount)"
strSQL = strSQL & " SELECT Date()as ChngeDate,
tblMaterialMaster.SISItemCode,"
strSQL = strSQL & " tblMaterialMaster.Discount, 'sglDiscount' as
NewDiscount"
strSQL = strSQL & " FROM tblMaterialMaster"
strSQL = strSQL & " WHERE ((tblMaterialMaster.SISItemCode) Like "
& """" & strItem & """)"
The above compiles and steps thru the entire code with no error but
does NOT update NewDiscount. It must be in the syntax.
Any thoughts please?