PC Review


Reply
Thread Tools Rate Thread

Dlookups ................!

 
 
=?Utf-8?B?QW5naWVN?=
Guest
Posts: n/a
 
      3rd Apr 2007
I have been trawling this board and the net generally but seem to be getting
nowhere so hope you can help.

I have a table called Products with 2 fields ProductCode (numeric) and
Product Name (text).

I have a form with a field StockCodeGroup (numeric the same as ProductCode).

In a text box i am tring to use a Dlookup as follows to return the product
name

DLOOKUP("[Product Name]","[Products]","[ProductCode]=Form!"[StockCodeGroup]")

I just result in a #Name? error

Can anyone tell me what i'm doing wrong or if i'm even vaguely on the right
track...

I didnt create the database and have little knowledge so any help gratefully
recieved.

Thank you

Angie x
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      3rd Apr 2007
If this is on the form where StockCodeGroup exists, try:

DLOOKUP("[Product Name]","[Products]","[ProductCode]=" &
Me![StockCodeGroup])

That assumes ProductCode is a numeric field. If it's text, try:

DLOOKUP("[Product Name]","[Products]","[ProductCode]=""" &
Me![StockCodeGroup] & """")

or

DLOOKUP("[Product Name]","[Products]","[ProductCode]='" &
Me![StockCodeGroup] & "'")

(I the first case, that's 3 double quotes in a row before the control name,
and 4 double quotes in a row after it. In the second case, it's single
quote-double quote before the control name, and double quote-single
quote-double quote after it.)

If you're trying to do this elsewhere, replace Me![StockCodeGroup] with
Forms!<NameOfForm>![StockCodeGroup] (replace <NameOfForm> with the name of
the form. If there are spaces in the form name, put square brackets around
it)



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"AngieM" <(E-Mail Removed)> wrote in message
news:12A4AB2F-6397-4028-B483-(E-Mail Removed)...
>I have been trawling this board and the net generally but seem to be
>getting
> nowhere so hope you can help.
>
> I have a table called Products with 2 fields ProductCode (numeric) and
> Product Name (text).
>
> I have a form with a field StockCodeGroup (numeric the same as
> ProductCode).
>
> In a text box i am tring to use a Dlookup as follows to return the product
> name
>
> DLOOKUP("[Product
> Name]","[Products]","[ProductCode]=Form!"[StockCodeGroup]")
>
> I just result in a #Name? error
>
> Can anyone tell me what i'm doing wrong or if i'm even vaguely on the
> right
> track...
>
> I didnt create the database and have little knowledge so any help
> gratefully
> recieved.
>
> Thank you
>
> Angie x



 
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
Nesting DLOOKUPs GD Microsoft Access Forms 4 2nd Jan 2009 06:37 PM
Multiple DLookups J Shrimps, Jr. Microsoft Access Form Coding 1 1st Mar 2006 01:41 AM
Many Dlookups any Problems? =?Utf-8?B?ZWIxbW9t?= Microsoft Access 2 19th Feb 2006 02:19 PM
VBA And Access and DLookups = GRR =?Utf-8?B?Q2hlcmlzaA==?= Microsoft Access Queries 2 15th Oct 2004 08:54 PM
If Then with DLookups - Not working Tim Miller Microsoft Access Form Coding 2 1st Aug 2003 06:31 PM


Features
 

Advertising
 

Newsgroups
 


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