P
PHisaw
Please forgive me for starting a new post, but it seems problem has changed a
little and the other post was left unanswered. I've always received a lot of
help here and am hoping someone can help me figure this one out. I'm trying
to append some records to a table for a subform and am now stuck with a
syntax error. All fields are numbers except model and module which are text.
All three fields are populated with the information on the form, but I can't
determine what is causing the error.
I've spent a considerable amount of time searching posts and changing sql
but it still throws error. If anyone can tell me what I'm doing wrong, I
would greatly appreciate it.
Thanks in advance,
Phisaw
Private Sub Command24_Click()
Dim db As DAO.Database
Dim strSQL As String
Set db = CurrentDb()
Debug.Print strWhere
strSQL = "INSERT INTO tsparepartssubform3 ( QuoteNumber, Model, Module,
PartIDNumber, Qty, Class1, Class2, Class3, DelWks )" & _
"SELECT tSparePartsMainForm.QuoteNumber, tSparePartsTemplate.Model,
tSparePartsTemplate.Module, tSparePartsTemplate.PartIDNumber,
tSparePartsTemplate.Qty, tSparePartsTemplate.Class1,
tSparePartsTemplate.Class2, tSparePartsTemplate.Class3,
tSparePartsTemplate.DelWks " & _
"FROM tSparePartsMainForm INNER JOIN tSparePartsTemplate ON
(tSparePartsMainForm.Module = tSparePartsTemplate.Module) AND
(tSparePartsMainForm.Model = tSparePartsTemplate.Model)" & _
"WHERE (((tSparePartsMainForm.QuoteNumber)= " &
Forms!fsparepartsmainform!QuoteNumber & _
"AND ((tSparePartsTemplate.Model)= '" & Forms!fsparepartsmainform!Model &
"', " & _
"AND ((tSparePartsTemplate.Module)= '" & Forms!fsparepartsmainform!Module &
"'); "
db.Execute strSQL, dbFailOnError
db.Close
Set db = Nothing
End Sub
it throws the Run-time error 3075
Syntax error (missing operator) in query expression
'(((tsparepartsmainform.quotenumber)= 25AND
((tsparepartstemplate.model)='111' AND
((tsparepartstemplate.module)='a');'
little and the other post was left unanswered. I've always received a lot of
help here and am hoping someone can help me figure this one out. I'm trying
to append some records to a table for a subform and am now stuck with a
syntax error. All fields are numbers except model and module which are text.
All three fields are populated with the information on the form, but I can't
determine what is causing the error.
I've spent a considerable amount of time searching posts and changing sql
but it still throws error. If anyone can tell me what I'm doing wrong, I
would greatly appreciate it.
Thanks in advance,
Phisaw
Private Sub Command24_Click()
Dim db As DAO.Database
Dim strSQL As String
Set db = CurrentDb()
Debug.Print strWhere
strSQL = "INSERT INTO tsparepartssubform3 ( QuoteNumber, Model, Module,
PartIDNumber, Qty, Class1, Class2, Class3, DelWks )" & _
"SELECT tSparePartsMainForm.QuoteNumber, tSparePartsTemplate.Model,
tSparePartsTemplate.Module, tSparePartsTemplate.PartIDNumber,
tSparePartsTemplate.Qty, tSparePartsTemplate.Class1,
tSparePartsTemplate.Class2, tSparePartsTemplate.Class3,
tSparePartsTemplate.DelWks " & _
"FROM tSparePartsMainForm INNER JOIN tSparePartsTemplate ON
(tSparePartsMainForm.Module = tSparePartsTemplate.Module) AND
(tSparePartsMainForm.Model = tSparePartsTemplate.Model)" & _
"WHERE (((tSparePartsMainForm.QuoteNumber)= " &
Forms!fsparepartsmainform!QuoteNumber & _
"AND ((tSparePartsTemplate.Model)= '" & Forms!fsparepartsmainform!Model &
"', " & _
"AND ((tSparePartsTemplate.Module)= '" & Forms!fsparepartsmainform!Module &
"'); "
db.Execute strSQL, dbFailOnError
db.Close
Set db = Nothing
End Sub
it throws the Run-time error 3075
Syntax error (missing operator) in query expression
'(((tsparepartsmainform.quotenumber)= 25AND
((tsparepartstemplate.model)='111' AND
((tsparepartstemplate.module)='a');'