469,326 Members | 1,320 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

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

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
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
2 2586
Nevermind Figured it out! apparently I had to have the last value in the DLookup function in " "

Thanks anyways
Dec 12 '06 #2
14,534 Expert Mod 8TB
String(text) values need to be enclosed in single quotes as follows:

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

Post your reply

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

Similar topics

10 posts views Thread by Gregory A Greenman | last post: by
121 posts views Thread by typingcat | last post: by
1 post views Thread by Frustrated Developer via DotNetMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.