473,569 Members | 2,984 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error with DLookUp

Hi all, i am running into problems with a DLookUp below:
=DLookUp("[Project Parts]","tblBuyerTota ls","[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 4206
Tempy wrote:
Hi all, i am running into problems with a DLookUp below:
=DLookUp("[Project Parts]","tblBuyerTota ls","[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]","tblBuyerTota ls","[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*******@devd ex.com> wrote:
Hi all, i am running into problems with a DLookUp below:
=DLookUp("[Project Parts]","tblBuyerTota ls","[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]","tblBuyerTota ls","[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
5148
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 database. I can't figure out where/how to check that the number exists before I get the error code 2105. Here's my function to get the number that I run...
1
1751
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 24 it won't send and Visual Basic gives me this warning : Runtime error '6' 554 5.7.1. Command rejected. When clicking on help it says something...
5
33077
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
4138
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 usage of the Elookup routine as a substitute for Dlookup. I read that Dlookup 'does not clean up after itself'. Most of the discussion centered...
10
5694
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 OwnerZip_AfterUpdate, CBF on frmOwnerEntryFrm. 2109: "There is no field named 'OwnerCity' in the current record." Private Sub...
4
1486
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 do this but when you enter a text value such as A you get
2
4416
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 assign a value to this object" on the first dlookup which is needed for the last three to run. so i figured that I could try puting them in the on load...
0
2737
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 product) to install my applications. When the Access Runtime was needed on the system I simply ran 'accessrt.msi' from Microsoft Office Developer...
8
3117
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 in Field2". If "OnError" event is used (error code 3022 in this case) the same error
15
3100
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 assign an Age Correction value to hearing test results - since some degree of hearing loss naturally occurs with aging - OSHA lets us calculate that in...
0
7930
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7681
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.