473,322 Members | 1,719 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.

DLookup error: " ...(missing operator) in query expression"

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 hand?

Table name: LUtblProvider
Table field names: provPKID, name, company, type, phone

Table name: tblRef
Table field names: refPKID, prov, event, src

Form: frmRef BOUND TO: qryRef and DISPLAYS query
results appropriately based on criteria specified. Value of
tblRef.prov **is** displayed on frmRef in textbox called "txtProv"

Problem:
Another textbox called "txtType" on frmRef is intended to display the
TYPE of provider. Idea was to use DLOOKUP to display PROV TYPE
corresponding to PROV NAME by interrogating LUtblProvider.

Following code in ControlSource of txtType:
=DLookUp("[type]","LUtblProvider","[name]= " & [Forms]![frmRef]!
[txtprov])

Receiving this error:
Syntax error (missing operator) in query expression '[name]= Jim
Adams'.
Note: Name Jim Adams is displayed in txtProv so Access is
recognizing the PROV NAME.

I will NOT admit to how long I have beat my forehead on the desk about
this!

Your help would be very much appreciated.

gary b

Feb 7 '07 #1
2 9014
On 6 Feb 2007 17:14:21 -0800, sf***@earthlink.net wrote:
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 hand?

Table name: LUtblProvider
Table field names: provPKID, name, company, type, phone

Table name: tblRef
Table field names: refPKID, prov, event, src

Form: frmRef BOUND TO: qryRef and DISPLAYS query
results appropriately based on criteria specified. Value of
tblRef.prov **is** displayed on frmRef in textbox called "txtProv"

Problem:
Another textbox called "txtType" on frmRef is intended to display the
TYPE of provider. Idea was to use DLOOKUP to display PROV TYPE
corresponding to PROV NAME by interrogating LUtblProvider.

Following code in ControlSource of txtType:
=DLookUp("[type]","LUtblProvider","[name]= " & [Forms]![frmRef]!
[txtprov])

Receiving this error:
Syntax error (missing operator) in query expression '[name]= Jim
Adams'.
Note: Name Jim Adams is displayed in txtProv so Access is
recognizing the PROV NAME.

I will NOT admit to how long I have beat my forehead on the desk about
this!

Your help would be very much appreciated.

gary b
Several problems that I can see.

1) Name is a reserved Access/VBA/Jet word and should not be used as a
field name.

2) Type is a Field property and also should not be used as a field
name.

For a more complete list of reserved words, see:
http://www.allenbrowne.com/AppIssueBadWord.html

3) What datatype is the field [Name]?
I would guess it's Text datatype. If so, after you change the names of
the Type and Name fields, use:

=DLookUp("[TypeField]","LUtblProvider","[NameField]= """ &
Me![txtprov] & """")

Note that I've used the Me keyword in place of forms!frmRef.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Feb 7 '07 #2
Thank you for the pointers, Fred. I will give them a try. I should
have remembered about the keyword issue. I ran into that before.
<slapping forehead!>

I will try your suggestions... I am sure they will work. I really
appreciate your willingness to help. Now if you will excuse me, I'm
going to go take some more Prozac!!

Thanks!

gary b
>
Several problems that I can see.

1) Name is a reserved Access/VBA/Jet word and should not be used as a
field name.

2) Type is a Field property and also should not be used as a field
name.

For a more complete list of reserved words, see:http://www.allenbrowne.com/AppIssueBadWord.html

3) What datatype is the field [Name]?
I would guess it's Text datatype. If so, after you change the names of
the Type and Name fields, use:

=DLookUp("[TypeField]","LUtblProvider","[NameField]= """ &
Me![txtprov] & """")

Note that I've used the Me keyword in place of forms!frmRef.

--
Fred


Feb 7 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: deko | last post by:
After developing an MDB in Access 2003 on WS03, then making it into an MDE and deploying it on a WinXP box with Access 2003 installed, I get this error: Function is not available in expressions...
0
by: John Smith | last post by:
Hi I am getting the above error when I try to run the union query shown below select all as , as , as , as , ,, ,, , , as , as , as , as , as from
6
by: Lars-Ove Andersson | last post by:
I have problem with the command "DLookup" in Access 2000. The command takes very long time to run. Have anybody any solution for this. //LOA
2
by: Jean | last post by:
Hello everyone, I was having the following problem with a query, and after failing to find a similar solution on these newsgroups I decided to post here. I am quite new to Access, so would...
11
by: MLH | last post by:
DLookup("", "tblPreliminaryVINs", "=Forms!frmVINODO!SerialNum") is giving me a Type Mismatch error. That's confusing to me and I don't know how to circumvent it. The field in...
10
by: PB | last post by:
Hi ! I have the following code, which I am using in an Embedded systems, c-compiler.. However I see the same problem with GCC too.. I need the last 10 bits of an address pointer, which is...
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
3
gcoaster
by: gcoaster | last post by:
Hello! I am having problem with DLookup Function DLookup looks on form, and finds the combobox = cboFullName and then compares it to the column clientID in tblCLIENTS table. if they match,...
5
by: maury | last post by:
Hello, I have a DB table with data filled from a weather sensor probe, I have one row every 10 minutes and the data fields is not in DateTime format but in string format: yyyyMMddHHmm So for...
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...
0
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.