473,396 Members | 2,033 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,396 software developers and data experts.

Error with DLookUp

Hi all, i am running into problems with a DLookUp below:
=DLookUp("[Project Parts]","tblBuyerTotals","[ByrName] =' " &
me!LastName)

This is in the Control Source of a text box on the same form.

"LastName" is a text box on the form, but i get an error message

("The object doesn't contain the Automation object 'me.') and then
("You tried to run a visual basic procedure to set a property or method
for
an object. However, the component doesn'y make the property or method
available for Automation operations")

As a newbie i am totally stumped, please heeeeeelp somebody
Tempy

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
3 4181
Tempy wrote:
Hi all, i am running into problems with a DLookUp below:
=DLookUp("[Project Parts]","tblBuyerTotals","[ByrName] =' " &
me!LastName)


You're missing a closing quote and in a Control expression you can't use
"Me" (nor do you need it).

=DLookUp("[Project Parts]","tblBuyerTotals","[ByrName] = '" & [LastName] &
"'")

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
Thanks rick this solved my problem.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3
On Wed, 08 Jun 2005 14:21:07 GMT, Tempy <an*******@devdex.com> wrote:
Hi all, i am running into problems with a DLookUp below:
=DLookUp("[Project Parts]","tblBuyerTotals","[ByrName] =' " &
me!LastName)

This is in the Control Source of a text box on the same form.

"LastName" is a text box on the form, but i get an error message

("The object doesn't contain the Automation object 'me.') and then
("You tried to run a visual basic procedure to set a property or method
for
an object. However, the component doesn'y make the property or method
available for Automation operations")

As a newbie i am totally stumped, please heeeeeelp somebody
Tempy

*** Sent via Developersdex http://www.developersdex.com ***


Looks like a syntax problem. You need a closing single quote after
me!LastName:

DLookUp("[Project Parts]","tblBuyerTotals","[ByrName] =' "
&me!LastName & " ' ")

Where single- and double-quotes are adjacent, remove the spaces
between them. I showed them only for illustrative purposes.

Frankly, I don't think you should be dealing with names at all for
such a query, since two separate buyers could theoretically have the
same last name. You're better off to have a buyer table with each
buyer uniquely identified with an auto-generated ID. The criteria for
your query would then be "BuyerID=" & me.BuyerID.

One other piece of advice, you probably want to do yourself a favour
and not use field names with spaces. Change [Project Parts] to
ProjectParts. This will eliminate the annoying need for square
brackets all the time.

Chuck
Nov 13 '05 #4

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

Similar topics

8
by: swathky | last post by:
I've tried mutiple things but no go -- (sorry this is so long) I'm collecting a 5 digit number in an input box function and all works fine until a number is passed that doesn't exist in the...
1
by: Ronny Sigo | last post by:
Hello all, I have a table which has 30 memofields each containing a text. (Approx. 1/2 page). Depending on various situations these texts are sent via e-mail. When the time comes to send text nr...
5
by: kildareguy | last post by:
I am getting this error when running a module in Access 2002...anyone know what it is? and how to correct it?
2
by: ctyrrell | last post by:
I have read with interest the many discussions of the 3048 Error: Cannot open any more databases. I understand how the number of open Table ID's causes the problem. My question has to do with the...
10
by: MLH | last post by:
Anybody know why I might be getting error #2109 during the procedure below? It does not occur on 2 desktops, but did on a laptop. The error said: "The following unexpected error occurred in Sub...
4
by: sparks | last post by:
If Not IsNull(DLookup(, "tblDemographic", " = """ & Me.Text9 & """")) Then Cancel = True MsgBox "Duplicate Value is Not Allowed" ActiveControl.Undo DoCmd.RunCommand acCmdUndo End If I try to...
2
MGrowneyARSI
by: MGrowneyARSI | last post by:
I am Trying to run a few dlookups on open of my form and as well as after update of my lookup. anyway when I tryed to put the dlookups in the on open event of the form I got the run time "You can't...
0
by: Sebastian | last post by:
Hello I develop my applications in Access 2002. My development system is running Windows XP SP2 and I have Microsoft Office XP Developer. Microsoft Office XP is at SP3. I used Inno Setup (great...
8
by: zyzolus | last post by:
Hello, I create 2 unique indexes on 2 fields: Field1 and Field2. What is the way generate custom error message independent of each field?ex.: "Duplicate value in Field1" or "Duplicate value...
15
by: rleepac | last post by:
This is a little complicated but I'll do my best to explain. In my db I have a table called L_AgeCorrection which has the following fields: Age, Sex, Frequency, AgeValue This is a table used to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.