My Assistant
![]() ![]() |
|
|
Dec 1 2009, 08:46 PM
Post
#1
|
|
|
UtterAccess Member Posts: 35 From: Albany, GA |
Hey,
I hope someone can take a look at my Dlookup statement and identify my error. I'm using the statement as the source for an unbound control on a Tab page. =Nz(DLookUp("[Address]","Bidders","BidderID = " & cboBidder.Column(0))) Address is a field in the table "Bidders". BidderID is a LongInt FK to the Bidders table. The combo box, cboBidder, is located on the same Tab page as the unbound control with this statement. I added the NZ because the value for BidderID will be null for many records. I've tried some variations on this statement, but this looks like one that should produce a good result. But no.. Thanks so much, Rick |
|
|
|
Dec 1 2009, 09:57 PM
Post
#2
|
|
|
UA Admin Posts: 19,380 From: Newcastle, WA |
I don't see a problem on the surface, although I think you do not need the column reference in the criteria.
Try it this way instead. =DLookUp("[Address]","Bidders","BidderID = " & NZ(cboBidder, 0)) |
|
|
|
Dec 2 2009, 06:23 AM
Post
#3
|
|
|
UtterAccess Member Posts: 35 From: Albany, GA |
Hi George,
I didn't see a problem with the statement either, but I like your arrangement better. Unfortunately it still didn't produce the result. I knew if your version didn't work, there had to be something I was overlooking. So I walked away, put it out of my mind and it suddenly hit me that I had the table wrong. It should be: =DLookUp("[Address]"," tblBidders ","BidderID = " & NZ([cboBidder],0)) Worked like a charm. I've really been struggling for awhile to master Access and I've made some great progress, but it's still easy to make stupid mistakes. Thanks for your guidance, George. I'm an avid reader of UA and I've been a big fan of your posts! Rick |
|
|
|
Dec 2 2009, 10:03 AM
Post
#4
|
|
|
UA Admin Posts: 19,380 From: Newcastle, WA |
Been there, Done That. We all have. It's part of the joy and frustration of working with my favorite application.
Continued success with your project. George |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 19th June 2013 - 10:26 PM |