Connecting Tech Pros Worldwide Help | Site Map

Syntax Error (Missing Operator) in query expression

khan
Guest
 
Posts: n/a
#1: Nov 13 '05
getting, error, 3075
Syntax Error (Missing Operator) in query expression '8WHERE
[Products].[ProductID]=1'


Dim TotalQty As Integer


TotalQty = DLookup("[QtyOnHand]", "[Products]", "[ProductID]=" &
Forms![tblProductUpdate]![Prod**uctID])
If (TotalQty - [Quantity]) < 8 Then
MsgBox "Inventory Below 0. Quantity Issued is To High!"
Cancel = True
Exit Sub
End If
TotalQty = TotalQty - [Quantity]
DoCmd.SetWarnings False
DoCmd.RunSQL ("UPDATE [Products] SET [Products].[QtyOnHand] =" &
TotalQty & _
"WHERE [Products].[ProductID] = " &
Forms![tblProductUpdate]![Prod**uctID])


AM i MISSING SOME THING in UPDATE QUERY

Randy Harris
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Syntax Error (Missing Operator) in query expression



"khan" <ahmad336@gmail.com> wrote in message
news:1115231820.415156.243120@o13g2000cwo.googlegr oups.com...
getting, error, 3075
Syntax Error (Missing Operator) in query expression '8WHERE
[Products].[ProductID]=1'


Dim TotalQty As Integer


TotalQty = DLookup("[QtyOnHand]", "[Products]", "[ProductID]=" &
Forms![tblProductUpdate]![Prod**uctID])
If (TotalQty - [Quantity]) < 8 Then
MsgBox "Inventory Below 0. Quantity Issued is To High!"
Cancel = True
Exit Sub
End If
TotalQty = TotalQty - [Quantity]
DoCmd.SetWarnings False
DoCmd.RunSQL ("UPDATE [Products] SET [Products].[QtyOnHand] =" &
TotalQty & _
"WHERE [Products].[ProductID] = " &
Forms![tblProductUpdate]![Prod**uctID])


AM i MISSING SOME THING in UPDATE QUERY

You have posted this same message with different subjects at least four
times. That is extremely rude. Your question has been answered elsewhere.


khan
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Syntax Error (Missing Operator) in query expression


instead of writing so many lines u could have tell me the answer

Chuck Grimsby
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Syntax Error (Missing Operator) in query expression


DoCmd.RunSQL ("UPDATE [Products] SET [Products].[QtyOnHand] =" &
TotalQty & _
"WHERE [Products].[ProductID] = " &
Forms![tblProductUpdate]![Prod**uctID]

Should be:

DoCmd.RunSQL ("UPDATE [Products] " & _
"SET [Products].[QtyOnHand] =" & _
TotalQty & " " & _
"WHERE [Products].[ProductID] = " & _
Forms![tblProductUpdate]![Prod**uctID]


You need a space between the TotalQty and the WHERE.

Larry Linson
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Syntax Error (Missing Operator) in query expression


"khan" wrote
[color=blue]
> instead of writing so many lines
> u could have tell me the answer[/color]

For good suggestions on effective use of newsgroups, see the FAQ at
http://www.mvps.org/access/netiquette.htm. You will see that posting the
same question multiple times, or the identical question in multiple
newsgroups is, at least, strongly discouraged. Whining when reminded of the
rules does not endear you to the very people best qualified to answer your
future questions.

Larry Linson




Closed Thread