By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

Using DLOOKUP Function to fill out Multiple Text Boxes ... Is this even possible

P: 2
I have been having trouble with a simple Dlookup command that was Reccommended to me by a nice fellow named Vic, On the other hand I have statements like this that wont run they give me a run time error

Dim QuoteNumber As String


QuoteNumber = Me.txtQuoteNumber


Me.txtDealerNumber = DLookup("Dealer_Number", "Quote Table", "Quote_Number=" & txtQuoteNumber)



Me.txtCustomerName = DLookup("Dealer_Name", "Dealers Table", "Dealer_Number=" & txtDealerNumber)

I have a problem with the second DLOOKUP function because I dont think it may be possible to fill out multiple text boxes using multiple Dlookup commands. I have all of this running off a Command Button. The first part works fine It will get me my dealer number from my Quote table but the next few I am going to have to refrence from a different table (Dealers Table) And soemthing it not working.. Im trying to autopopulate
DealerName
Dealer Address
Dealer City
Dealer State
Dealer zip
Dealer phone
Dealer Contact

All refrenced off of the Dealer Number that I had retrieved from the last DLookup
and now Dealers Table
Any suggestions?
Dec 12 '06 #1
Share this Question
Share on Google+
2 Replies


P: 2
Nevermind Figured it out! apparently I had to have the last value in the DLookup function in " "

Thanks anyways
Dec 12 '06 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
String(text) values need to be enclosed in single quotes as follows:

Expand|Select|Wrap|Line Numbers
  1. Dim QuoteNumber As String
  2.  
  3.    QuoteNumber = Me.txtQuoteNumber
  4.    Me.txtDealerNumber = DLookup("Dealer_Number", "Quote Table", "Quote_Number='" & txtQuoteNumber & "'")
  5.  
  6.  
Mary
Dec 13 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.