473,322 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

missing operator in query expression

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
2 1909
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: alexz | last post by:
valuA = (request.form("toadd")) If valuA = "" then SQL = "UPDATE CourseReg SET attended='Active' WHERE ID IN("&request.form("toadd")&")" Set RS = MyConn.Execute(SQL) End If MyConn.Close Set...
29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
4
by: dcarson | last post by:
I've read about this error in several other discussions, but still can't seem to pinpoint the problem with my code. Everything seemed to be working fine for some time, but it now tends to bomb out...
3
by: Lumpierbritches | last post by:
Syntax Error (missing operator) in query expression =BLANK'S MOLLIE-PRINCE BRUISER-3/14/2004-03 AnimalID is correct. I'm trying to open with a command button or double click the frmAnimal from a...
4
by: khan | last post by:
getting, error, 3075 Syntax Error (Missing Operator) in query expression '8WHERE .=1' Dim TotalQty As Integer TotalQty = DLookup("", "", "=" & Forms!!)
7
by: Chucky | last post by:
I have been going crazy slowly all week. When I step through my code I get Run Time Error 3075, Syntax error, Missing Operator in Query Expression. I think that I have narrowed the error down to...
2
by: sfrvn | last post by:
I am embarrassed to say I cannot make this work. Recently upgraded to Access 2003, but do not know if that part of problem (AKA 'syntax change'). Would someone be kind enough to lead me by the...
4
by: thebarefootnation | last post by:
Hi I have the following error message "Syntax Error (missing operator) in query expression" occurring when I am trying to update combo box within a form. My code is: Dim strSQL As String
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.