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 / July 2007

Tip: Looking for answers? Try searching our database.

dlookup right from Help not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 14 Jul 2007 00:48 GMT
I have a Form 'frmTest DLookup' that is used to input data into a table
'tblTest DLookup'.  The table was build with a lookup to the 'Contacts' table
to provide a drop-down of available contacts when completing the form.

The 'tblContacts' contains 'ContactName' and 'ContactEmail' fields
The 'frmTest DLookup' contains 'Contact' and 'Email' fields used for entry
into the 'tblTest DLookup'

I am trying to use DLookup to populate the 'ContactEmail' field in the form
and thus the underlying table based on the value entered in the 'Contact'
field of the same form.
This is the solution straight from the MS Help (modified w/ my names of
course):
DLookup("[ContactEmail]","[Contacts]","[ContactName] = Forms![Contact]")

I've placed it in the Control Source of the 'ContactEmail' field of the form.
It returns #Name? in the Contact Email field of the form.
If I add an '+' at the front, the 'ContactEmail' field stays blank and can
not be clicked on.

Any help on this?  Another method?  I've read about the SELECT Query but am
not sure where to place that.

Thanks
Bob Quintal - 14 Jul 2007 00:20 GMT
> I have a Form 'frmTest DLookup' that is used to input data
> into a table 'tblTest DLookup'.  The table was build with a
[quoted text clipped - 24 lines]
>
> You need an = in front of it
=DLookup("[ContactEmail]","[Contacts]" "[ContactName] =

You will also need to put the name of the form in the criteria

Forms![What's the name of the form?]![Contact]")

Signature

Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

John - 16 Jul 2007 16:24 GMT
When I add the '=' and the '[Form Name]!', The field does not populate with
any information and is write protected.  The '#NAME?' is gone though so I
think some progress is made.  

(I have verified that there is information in the 'contactEmail' field
within the 'Contacts' table.)

> > I have a Form 'frmTest DLookup' that is used to input data
> > into a table 'tblTest DLookup'.  The table was build with a
[quoted text clipped - 29 lines]
>
> Forms![What's the name of the form?]![Contact]")
 
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



©2009 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.