473,385 Members | 1,562 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,385 software developers and data experts.

DLookUp

Hi,

I want t display several fields in one label box using the DLookUp function.
I have tried using below but all I get is '-1' when I preview the report.
Any idea's?

=DLookUp("[Company Name]" And "[Address 1]","tblCompanyDetails")

--

Kind Regards...

Customer Services Team
Blue Bell Trading

+++ WHEN REPLYING PLEASE DO NOT DELETE ANY OF THE TEXT AS WE NEED IT FOR
REFERENCE +++

Blue Bell Trading
Nov 13 '05 #1
11 2829
"Nick J" <bl*************@blueyonder.co.uk> wrote in message
news:UG*****************@fe3.news.blueyonder.co.uk ...
Hi,

I want t display several fields in one label box using the DLookUp
function. I have tried using below but all I get is '-1' when I preview
the report. Any idea's?

=DLookUp("[Company Name]" And "[Address 1]","tblCompanyDetails")

--

Kind Regards...

Customer Services Team
Blue Bell Trading

+++ WHEN REPLYING PLEASE DO NOT DELETE ANY OF THE TEXT AS WE NEED IT FOR
REFERENCE +++

Blue Bell Trading

I'm not sure that DLookup can be used in this manner. Why not concatenate
the fields in a query and do the DLookup on that?

Regards,
Keith.
www.keithwilby.com
Nov 13 '05 #2
"Nick J" <bl*************@blueyonder.co.uk> wrote in message
news:UG*****************@fe3.news.blueyonder.co.uk ...
Hi,

I want t display several fields in one label box using the DLookUp
function. I have tried using below but all I get is '-1' when I preview
the report. Any idea's?

=DLookUp("[Company Name]" And "[Address 1]","tblCompanyDetails")


I suppose you want to get the Company Name
together with their address.
If so try:

=DLookUp("[Company Name]","tblCompanyDetails") & " " & DLookUp("[Address
1]","tblCompanyDetails")

Bruno
Nov 13 '05 #3
On Fri, 22 Apr 2005 09:43:16 GMT, Nick J wrote:
Hi,

I want t display several fields in one label box using the DLookUp function.
I have tried using below but all I get is '-1' when I preview the report.
Any idea's?

=DLookUp("[Company Name]" And "[Address 1]","tblCompanyDetails")


A DlookUp can only returen the value of 1 field.
Is the Company and Address your company, or is it one of many
companies?

If it is your comapnay name and address, then use:
=DLookUp("[CompanyName]","tblCompanyDetails") & chr(13) & chr(10) &
DLookUp ("[Address]","tblCompanyDetails")

Bell Company
123 Some Street

If you wish it all on one line then replace the chr(13) & chr(10) with
" " (see the next example below).

However, if the company is one of several companies in the table, you
need to use criteria to get the correct one.
=DLookUp("[CompanyName]","tblCompanyDetails","[CompanyID] = " &
someCriteria) & " " &
DLookUp("[Address]","tblCompanyDetails","[CompanyID] = " & Some
Criteria)

Joe Blow Inc. 123 Some street
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #4
Nick J wrote:
Hi,

I want t display several fields in one label box using the DLookUp function.
I have tried using below but all I get is '-1' when I preview the report.
Any idea's?

=DLookUp("[Company Name]" And "[Address 1]","tblCompanyDetails")


You're doing a Boolean expression there m8 :-)

Try
=DLookUp("[Company Name] & ' ' & [Address 1]","tblCompanyDetails")

If that don't work then try my replacement domain functions
(http://easyweb.easynet.co.uk/~trevor.../baslookup.zip) as
that'll have no problem with this syntax:

=tLookUp("[Company Name] & ' ' & [Address 1]","tblCompanyDetails")
--
[Oo=w=oO]

Nov 13 '05 #5
"Trevor Best" <no****@besty.org.uk> wrote in message
news:42**********************@news.zen.co.uk...
Try
=DLookUp("[Company Name] & ' ' & [Address 1]","tblCompanyDetails")


It can't work!

Bruno
Nov 13 '05 #6
Bruno Campanini wrote:
"Trevor Best" <no****@besty.org.uk> wrote in message
news:42**********************@news.zen.co.uk...

Try
=DLookUp("[Company Name] & ' ' & [Address 1]","tblCompanyDetails")

It can't work!


I wouldn't know, I've never tried it in DLookup() that's why I
recommended tLookup(), which will work like that.

--
[Oo=w=oO]

Nov 13 '05 #7

"Nick J" <bl*************@blueyonder.co.uk> wrote in message
news:UG*****************@fe3.news.blueyonder.co.uk ...
Hi,

I want t display several fields in one label box using the DLookUp function. I have tried using below but all I get is '-1' when I preview the report.
Any idea's?

=DLookUp("[Company Name]" And "[Address 1]","tblCompanyDetails")

--

Kind Regards...

Customer Services Team
Blue Bell Trading

+++ WHEN REPLYING PLEASE DO NOT DELETE ANY OF THE TEXT AS WE NEED IT FOR
REFERENCE +++

Blue Bell Trading


Build up the string just as you would in a query

DLookUp("[Company Name] & """ """ & [Address 1]","tblCompanyDetails")

Nov 13 '05 #8
Bruno Campanini wrote:
"Trevor Best" <no****@besty.org.uk> wrote in message
news:42**********************@news.zen.co.uk...

Try
=DLookUp("[Company Name] & ' ' & [Address 1]","tblCompanyDetails")

It can't work!


Actually I just tried it in my test database:

<------
?Dlookup("[ID] & ' ' & [Wibble]","Table1")
5 gggg
------->

--
[Oo=w=oO]

Nov 13 '05 #9
"Trevor Best" <no****@besty.org.uk> wrote in message
news:42**********************@news.zen.co.uk...
Bruno Campanini wrote:
"Trevor Best" <no****@besty.org.uk> wrote in message
news:42**********************@news.zen.co.uk...

Try
=DLookUp("[Company Name] & ' ' & [Address 1]","tblCompanyDetails")

It can't work!


Actually I just tried it in my test database:

<------
?Dlookup("[ID] & ' ' & [Wibble]","Table1")
5 gggg


Yes, indeed!
I tried something like "[ID]" & " " & "[Wibble]" and
Access is unable to read two fields this way.
I'd never suppose it could do it your way.

But it does!
Surprise in Access is a never-ending story.

Bruno
Nov 13 '05 #10
Thats worked great, thanks for all your help.

--

Kind Regards...

Customer Services Team
Blue Bell Trading

+++ WHEN REPLYING PLEASE DO NOT DELETE ANY OF THE TEXT AS WE NEED IT FOR
REFERENCE +++

Blue Bell Trading
"fredg" <fg******@example.invalid> wrote in message
news:1n******************************@40tude.net.. .
On Fri, 22 Apr 2005 09:43:16 GMT, Nick J wrote:
Hi,

I want t display several fields in one label box using the DLookUp
function.
I have tried using below but all I get is '-1' when I preview the report.
Any idea's?

=DLookUp("[Company Name]" And "[Address 1]","tblCompanyDetails")


A DlookUp can only returen the value of 1 field.
Is the Company and Address your company, or is it one of many
companies?

If it is your comapnay name and address, then use:
=DLookUp("[CompanyName]","tblCompanyDetails") & chr(13) & chr(10) &
DLookUp ("[Address]","tblCompanyDetails")

Bell Company
123 Some Street

If you wish it all on one line then replace the chr(13) & chr(10) with
" " (see the next example below).

However, if the company is one of several companies in the table, you
need to use criteria to get the correct one.
=DLookUp("[CompanyName]","tblCompanyDetails","[CompanyID] = " &
someCriteria) & " " &
DLookUp("[Address]","tblCompanyDetails","[CompanyID] = " & Some
Criteria)

Joe Blow Inc. 123 Some street
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Nov 13 '05 #11
Sorry is sent this direct to Nick J
Prehaps a Text box may be better
Try =DLookUp("[Company Name]" ,tblCompanyDetails") & " " & DLookUp(
"[Address 1]","tblCompanyDetails")
This assumes u have only 1 record in tblCompanyDetails or U want the first
Record in the current sort order
If U want on 2 lines then insert vbcrlf instead " "

--
Murray Carter
"Nick J" <bl*************@blueyonder.co.uk> wrote in message
news:UG*****************@fe3.news.blueyonder.co.uk ...
Hi,

I want t display several fields in one label box using the DLookUp function. I have tried using below but all I get is '-1' when I preview the report.
Any idea's?

=DLookUp("[Company Name]" And "[Address 1]","tblCompanyDetails")

--

Kind Regards...

Customer Services Team
Blue Bell Trading

+++ WHEN REPLYING PLEASE DO NOT DELETE ANY OF THE TEXT AS WE NEED IT FOR
REFERENCE +++

Blue Bell Trading

Nov 13 '05 #12

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

Similar topics

1
by: KLAU | last post by:
I have a field that retrieves information from an expression in a query. I have used a DLookup function to get the calculated field from the query. However, the relationship is 1-to-many so one...
6
by: JLM | last post by:
What am I missing here? I have a form where I enter a "Class Code". This value corresponds to what sits in table "class code descriptions" along with the "title" of each "class code." Key...
4
by: MLH | last post by:
I have tried using DLookUp in this manner... If DLookUp("","tblClients","='2021234567'") Then MsgBox "Found it!" End If I am wondering if that is a misuse of the DLookUp command? Type...
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...
8
by: Christine Henderson | last post by:
I have a problem using the above function in the following simplified circumstance: In the lookup table called "Klms Travelled" I have 3 fields, eg: Receiver Name Receiver Suburb ...
11
by: MLH | last post by:
DLookup("", "tblPreliminaryVINs", "=Forms!frmVINODO!SerialNum") is giving me a Type Mismatch error. That's confusing to me and I don't know how to circumvent it. The field in...
2
by: Don | last post by:
Can someone help me fix my DLookup problem. I'm far from proficiency with Access. I've been creating databases for several years for work with the help of many of you and trial and error. I have...
9
by: | last post by:
In my database I have a 'control table' in which basic info is stored about the application, for instance the application's path and the name of the company that is using it. In all of the...
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...
8
by: JDaly | last post by:
This bombs on the StPL= line. I want it to look up a string value from a table with a criterion of matching another string. In immediate mode the form evaluates correctly with ? Form!! as TEST but...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.