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 / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

DLookUp error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cmraguilar - 29 Jan 2008 16:00 GMT
I'm having issues with a DLookUp function.  Its set up, or so I think, to
pull a company name from a combo box and then display their WSI number.  The
combo box also executes 2 quries in seperate subforms On Change and On Got
Focus.  When the DLookUp is set as below, I get a #Error.  But when I set the
combo box set the "Bound Comlumns" = 2, the text box will display the number
but will I get a Run-time error '3420' Object invalid or no longer set.  

Any help would be appreciated.

=DLookUp("[ParentWSINumber]","tblSupplierParent","[SupplierName]='" &
Nz(Forms![Supplier Contact Information]!cboSupplierParentName) & "'")
Jim B - 29 Jan 2008 18:45 GMT
The bound column from the Lookup box is usually the ID Number from whatever
recordset is used for the combo box.  The second column displays the data -
in this case, the SupplierName.  In your Dlookup function, you are looking
for a text value of SupplierName, but the boundcolumn of the box is probably
a number.  Try using the column property of the combo box.

=DLookUp("[ParentWSINumber]","tblSupplierParent","[SupplierName]='" &
Nz(Forms![Supplier Contact Information]!cboSupplierParentName.Column(2)) &
"'")

This will let you reference the text value, rather that the numeric value.

> I'm having issues with a DLookUp function.  Its set up, or so I think, to
> pull a company name from a combo box and then display their WSI number.  The
[quoted text clipped - 7 lines]
> =DLookUp("[ParentWSINumber]","tblSupplierParent","[SupplierName]='" &
> Nz(Forms![Supplier Contact Information]!cboSupplierParentName) & "'")
cmraguilar - 29 Jan 2008 19:12 GMT
Thanks for your help.  I appreaciate the detailed explination rather than
just respoding with the code.  It helps me understand the why, rather than
the how. The only change I needed to make was reference it to column(1)
rather than column(2).  

> The bound column from the Lookup box is usually the ID Number from whatever
> recordset is used for the combo box.  The second column displays the data -
[quoted text clipped - 19 lines]
> > =DLookUp("[ParentWSINumber]","tblSupplierParent","[SupplierName]='" &
> > Nz(Forms![Supplier Contact Information]!cboSupplierParentName) & "'")
 
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.