PC Review


Reply
Thread Tools Rate Thread

Dlookup problems (was my Dlookup hell)

 
 
Kavvy
Guest
Posts: n/a
 
      18th Nov 2003
Hi,

Thanks to those who helped me out with my last query, the changes make sense
to me but I am now getting a new error which is confusing!

Run-time error 2471

The expression you entered as a query parameter produced this error: 'The
object doesn't contain the Automation object 'Sub."

This is my code which executes on a After Update event

Me!Department = DLookup("Sub-Department", "QRY Employees", "[Payroll No] = "
& Forms![FRM Jobs]![Payroll No])

Thanks for your help!
K.


 
Reply With Quote
 
 
 
 
Treebeard
Guest
Posts: n/a
 
      18th Nov 2003
Try

DLookup("[Sub-Department]", "[QRY Employees]", "[Payroll No] = "
& Forms![FRM Jobs]![Payroll No])



"Kavvy" <1@1.1> wrote in message
news:Eglub.3442$(E-Mail Removed)...
> Hi,
>
> Thanks to those who helped me out with my last query, the changes make

sense
> to me but I am now getting a new error which is confusing!
>
> Run-time error 2471
>
> The expression you entered as a query parameter produced this error: 'The
> object doesn't contain the Automation object 'Sub."
>
> This is my code which executes on a After Update event
>
> Me!Department = DLookup("Sub-Department", "QRY Employees", "[Payroll No] =

"
> & Forms![FRM Jobs]![Payroll No])
>
> Thanks for your help!
> K.
>
>



 
Reply With Quote
 
Kavvy
Guest
Posts: n/a
 
      18th Nov 2003

"Treebeard" <(E-Mail Removed)> wrote in message
news:JZydnXDCr8MenieiRVn-(E-Mail Removed)...
> Try
>
> DLookup("[Sub-Department]", "[QRY Employees]", "[Payroll No] = "
> & Forms![FRM Jobs]![Payroll No])
>
>
>


It works dammit!!!

I found this confusing because the first part of the query worked if I
simply put something like this

DLookup("Sub-Department", "QRY Employees", "[Payroll No] = 10")

Which would put 10 into the field, but then adding the field search also
required the [] brackets as you pointed out...

Thanks again
K


 
Reply With Quote
 
Treebeard
Guest
Posts: n/a
 
      18th Nov 2003
In the future don't put spaces or minus signs as names of your fields or
tables.
;-)
jack


"Kavvy" <1@1.1> wrote in message
news:6Gnub.3572$(E-Mail Removed)...
>
> "Treebeard" <(E-Mail Removed)> wrote in message
> news:JZydnXDCr8MenieiRVn-(E-Mail Removed)...
> > Try
> >
> > DLookup("[Sub-Department]", "[QRY Employees]", "[Payroll No] = "
> > & Forms![FRM Jobs]![Payroll No])
> >
> >
> >

>
> It works dammit!!!
>
> I found this confusing because the first part of the query worked if I
> simply put something like this
>
> DLookup("Sub-Department", "QRY Employees", "[Payroll No] = 10")
>
> Which would put 10 into the field, but then adding the field search also
> required the [] brackets as you pointed out...
>
> Thanks again
> K
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dlookup using a date defiined by another dlookup =?Utf-8?B?QmVubnlESGlsbA==?= Microsoft Access VBA Modules 1 8th Aug 2007 01:56 AM
Re: Dlookup function - copying the dlookup info into a field.... Douglas J. Steele Microsoft Access Forms 0 6th Dec 2006 02:05 PM
dlookup problems =?Utf-8?B?c2Vkcw==?= Microsoft Access Forms 4 29th Apr 2005 06:42 PM
DLOOKUP Problems =?Utf-8?B?Sm9oblQ=?= Microsoft Access Getting Started 6 15th Jan 2004 01:16 AM
my Dlookup hell Kavvy Microsoft Access Form Coding 3 17th Nov 2003 04:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:43 PM.