By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,739 Members | 1,523 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,739 IT Pros & Developers. It's quick & easy.

missing operator in query expression

P: n/a
I have a form for users to enter part numbers. The form has 5 text boxes for
each part. Part No1 has a text box for the user to enter his part no., along
with a description box, price box, a quantity box, and a total box.

After the user enters his part number the description and price will appear
in their respective boxes. The user then enters a quantity and the last
field is a calculated total.

I am using a DLookup for the price and description fields, but when I use the
following code...

Private Sub txtPartNo_AfterUpdate()
Me.txtPrice = Nz(Dlookup("NET PRICE", "parts_price_dump", "txtPartNo =
[ITEM]"),"")
Me.txtDescription = Nz(Dlookup("Description", "parts_price_dump",
"txtPartNo = [ITEM]"),"")
End Sub

....after entering the part number and pressing tab to go to the quantity
field an error box appears saying I have a missing query operator in the
query expression 'NET PRICE'.
What's going on. I had this working earlier with a different table. When I
switched tables and changed the name in my code it stopped working.
Any help would be greatly appreciated.

Shannan Casteel
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200508/1
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Tue, 02 Aug 2005 16:29:08 GMT, Shannan Casteel via
AccessMonster.com wrote:
I have a form for users to enter part numbers. The form has 5 text boxes for
each part. Part No1 has a text box for the user to enter his part no., along
with a description box, price box, a quantity box, and a total box.

After the user enters his part number the description and price will appear
in their respective boxes. The user then enters a quantity and the last
field is a calculated total.

I am using a DLookup for the price and description fields, but when I use the
following code...

Private Sub txtPartNo_AfterUpdate()
Me.txtPrice = Nz(Dlookup("NET PRICE", "parts_price_dump", "txtPartNo =
[ITEM]"),"")
Me.txtDescription = Nz(Dlookup("Description", "parts_price_dump",
"txtPartNo = [ITEM]"),"")
End Sub

...after entering the part number and pressing tab to go to the quantity
field an error box appears saying I have a missing query operator in the
query expression 'NET PRICE'.

What's going on. I had this working earlier with a different table. When I
switched tables and changed the name in my code it stopped working.

Any help would be greatly appreciated.

Shannan Casteel


Is "txtPartNo" a Number datatype field?

Private Sub txtPartNo_AfterUpdate()

Me!txtPrice = Nz(Dlookup("[NET PRICE]", "parts_price_dump",
"[txtPartNo] = " & Me![ITEM]),0)

Me!txtDescription = Nz(Dlookup("[Description]", "parts_price_dump",
"[txtPartNo] = " & Me![ITEM]),"No Description")

End Sub
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2

P: n/a
"Shannan Casteel via AccessMonster.com"
<fo***@AccessMonster.com> wrote in
news:52***********@AccessMonster.com:
I have a form for users to enter part numbers.
I am using a DLookup for the price and description fields, but
when I use the following code...

Private Sub txtPartNo_AfterUpdate()
Me.txtPrice = Nz(Dlookup("NET PRICE", "parts_price_dump",
"txtPartNo =
[ITEM]"),"")
an error box appears saying I have a
missing query operator in the query expression 'NET PRICE'.
What's going on. I had this working earlier with a different
table. When I switched tables and changed the name in my code
it stopped working.
Any help would be greatly appreciated.

Shannan Casteel

"Net Price" is unacceptable because it contains a space. You can
fix the problem by renaming to NetPrice, or Net_Price". You can
also delimit the "Net Price" in your dlookup with square
brackets, making it "[Net Price]".
--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.