Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

How do I use the Dlookup function?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Justin Barnett - 11 Jan 2005 16:57 GMT
=DLookUp("[PCC]","Location","[TXUsite] = Forms![Transactions]![TXUsite]")

This is returning nothing to my PCC field in my form. Where do I need to
place this funtion and is this correct?
Paul B. - 11 Jan 2005 17:25 GMT
Try this:

=DLookUp("[PCC]","Location","[TXUsite] =" & Forms![Transactions]![TXUsite])

Cheers

> =DLookUp("[PCC]","Location","[TXUsite] = Forms![Transactions]![TXUsite]")
>
> This is returning nothing to my PCC field in my form. Where do I need to
> place this funtion and is this correct?
Justin Barnett - 11 Jan 2005 17:39 GMT
It's returning nothing to my field... any suggestions?

> Try this:
>
[quoted text clipped - 6 lines]
> > This is returning nothing to my PCC field in my form. Where do I need to
> > place this funtion and is this correct?
fredg - 11 Jan 2005 17:32 GMT
> =DLookUp("[PCC]","Location","[TXUsite] = Forms![Transactions]![TXUsite]")
>
> This is returning nothing to my PCC field in my form. Where do I need to
> place this funtion and is this correct?

What is the datatype of the [TXUsite]? Number or Text?
Is this code being placed in an event on theTransaction form or in a
control source of an UNBOUND control on that form? Or on a different
form? It makes a difference.

Assuming [PCC] and [TXUsite] are field's in the [Location] table, and
you have a form with a control named [TCUsite].....

1)  As code in an event on the Transaction form assuming [TXUsite] is
text:
=DLookUp("[PCC]","Location","[TXUsite] = '" & Me![TXUsite] & "'")

If the [TXUsite] is a Number datatype then use:
"[TXUsite] = " & Me![TXUsite])

2)  In a control source on that form:
=DLookUp("[PCC]","Location","[TXUsite] = '" [TXUsite] & "'")

If the [TXUsite] is a Number datatype then use:
"[TXUsite] = " & [TXUsite])

3)  On a different form or in a Module:
=DLookUp("[PCC]","Location","[TXUsite] = '" &
Forms![Transactions]![TXUsite] & "'")

If the [TXUsite] is a Number datatype then use:
"[TXUsite] = " & Forms!Transaction![TXUsite])

The form "Transaction" must be open when the DLookUp is run.

Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.