Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 22nd, 2007, 02:30 PM
Registered User
Join Date: Nov 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AidanEnos
Default DlookUp Macro failing


This should work but doesn't and driving me nuts - not even sure where it's failing!!!

As I understand it, this code says...

I want the CustomerName field from the CustomersTable input to the CustomerName field on the active form and I want the CustomerName from the Entry in the CustomersTable that is in the record I just selected with the cboList box.

(I have it set to after Update on the cboList field)

DLookUp("CustomerName","CustomersTable","CustomerN ame = " & [cboList])

I know I'm missing some quotes or brackets or soemthing - I've tried a plethera of combinations - now show me the right choice!

Reply With Quote
  #2 (permalink)  
Old November 23rd, 2007, 12:51 AM
Friend of Wrox
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post

Welcome to P2P Mike-

I assume that cboList's data type is text. If so, concatenate another single quote into the first string and one after [cboList].

DLookUp("CustomerName","CustomersTable","CustomerN ame = '" & [cboList])& "'"

Your syntax is correct if cboList is a numeric (as opposed to text).

One of those "gotcha's"


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
calling to xlam macro from macro inside xlsb SteveB Excel VBA 0 June 30th, 2008 06:43 PM
Dlookup problems jik VB How-To 0 February 15th, 2007 04:27 PM
Help with DLookup Devilboy13 Access VBA 4 August 30th, 2006 02:48 PM
Help - Dlookup function kk_sg Access VBA 3 August 23rd, 2006 11:30 AM
DLookup Teqlump Access VBA 1 August 9th, 2006 11:48 PM

All times are GMT -4. The time now is 07:47 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.