Error msg when using me.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

"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
 
The Me. Keyword will only work in the form's own module, not in a
general module. Any chance the code is in a general module? If yes, then
you need to reference the form explicitly, like:

=DLookUp("[Project Parts]","tblBuyerTotals","[ByrName] =' " _
& Forms("YourFormNameHere").LastName)

HTH,
Nikos
 
Hi Nikos, The DLookUp is in the Control Source of a text box on the same form.
I changed it to =DLookUp("[Project Parts]","tblBuyerTotals","ByrName = '"
& Forms("frmByrDetails").LastName)

Now i get the error ( Syntax error in string in query 'ByrName = 'Baden' )

this tells me it is seeing the name, but there is an error i have tried
changing apostrophies with no luck ?

--
Les


Nikos Yannacopoulos said:
The Me. Keyword will only work in the form's own module, not in a
general module. Any chance the code is in a general module? If yes, then
you need to reference the form explicitly, like:

=DLookUp("[Project Parts]","tblBuyerTotals","[ByrName] =' " _
& Forms("YourFormNameHere").LastName)

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

"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
 
Hi All, i solved this problem with the following:

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

This works 100%

--
Les


Newbie said:
Hi Nikos, The DLookUp is in the Control Source of a text box on the same form.
I changed it to =DLookUp("[Project Parts]","tblBuyerTotals","ByrName = '"
& Forms("frmByrDetails").LastName)

Now i get the error ( Syntax error in string in query 'ByrName = 'Baden' )

this tells me it is seeing the name, but there is an error i have tried
changing apostrophies with no luck ?

--
Les


Nikos Yannacopoulos said:
The Me. Keyword will only work in the form's own module, not in a
general module. Any chance the code is in a general module? If yes, then
you need to reference the form explicitly, like:

=DLookUp("[Project Parts]","tblBuyerTotals","[ByrName] =' " _
& Forms("YourFormNameHere").LastName)

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

"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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Access Access macro build gone wrong 0
Automation Error??? 5
Trying to populate data using a Macro 3
Error Msg 3
Problem with Nulls 7
DLookup 7
Access MS Access DLookup 1
Problem with form--subform 5

Back
Top