conteHome > Ms Access > Ms Access Dlookup Not Working

Ms Access Dlookup Not Working

Privacy Policy Site Map Support Terms of Use Mike Friday, March 15, 2013 4:55 PM Reply | Quote Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. I hope others may benefit from this simple tidbit. 0 Featured Post How to improve team productivity Promoted by Quip, Inc Quip adds documents, spreadsheets, and tasklists to your Slack experience Once Karl explained that it was a quick fix. this contact form

Getting error that I can't figure out VBA: Duplicated code in another form is not working How to make DLookUP function works.. Mike Thursday, March 14, 2013 3:14 PM Reply | Quote 1 Sign in to vote Private Sub cboZipCheck_AfterUpdate() Me.txtCity = DLookup("City", "tblZipCodes", "Zipcode” = me.cboZipCheck) Me.txtCity = DLookup("State", "tblZipCodes", One table, one form. The only info that needs to be stored in the Record Source (using the control source) should be that customer code (I would think). http://www.access-programmers.co.uk/forums/showthread.php?t=204289

Web|-- Other Microsoft ProductsPC|-- Network Issues|-- Q & A - Hardware|-- Q & A - Software|-- Q & A - Other PC|-- Virus + Security DiscussionUtterAccess Odds and Ends|-- General Chat|-- Thanks for the effort in helping. I'm sure it's a syntax issue but I can't seem to get the DLookup to work while using the variable: loginID vba ms-access access-vba ms-access-2010 share|improve this question edited Mar 19

If you look at the posted example (I've indicated character positions) : Expand|Select|Wrap|Line Numbers 12345678 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456 CustomerName=dlookup("CustomerName","Customers","customerCode="'&CustomerCode)&"'" A single quote (') is treated as a comment indicator in VBA unless it Did the Gang of Four really thoroughly explore "Pattern Space"? People will make efforts to help you at your level if you make it clear what it is you can understand. What is the number of parameters for AIC if some coefficients are zero?

Then the code would simply be: Me!txtState = Me!cboZipCheck.Column(2) Me!txtCity = Me!cboZipCheck.Column(3) -- cu Karl ********* Access-FAQ (German/Italian): http://www.donkarl.com Edited by Karl DonaubauerMVP Thursday, March 14, 2013 3:57 PM line breaks I now get the following error though: "The expression After Update you entered as the event property setting produced the following error: Syntax error" As "Company" is text, I changed the If you look at the characters at positions #64 & #65, you'll notice the double-quote (") appears before the single-quote ('). http://stackoverflow.com/questions/22514876/dlookup-not-working-when-using-a-variable And there are no error messages or codes - just blank fields.

Hi Mike, "Zipcode = '28806'" works because the Zipcode field is defined as a Text field. No extraneous DLookups() required even. No, following your description this should work: DLookup("City", "tblZipCodes", "Zipcode='" & Me!cboZipCheck.Column(1) & "'") DLookup("State", "tblZipCodes", "Zipcode='" & Me!cboZipCheck.Column(1) & "'") Alternatively you could change the row source of cboZipCheck to Join Now For immediate help use Live now!

I could, but the problem is just now resolved. http://answers.microsoft.com/en-us/msoffice/forum/msoffice_access-mso_other/dlookup-not-working-in-access-subform/917965fc-a6c3-4de6-b31c-32283059fcab When you get the error message try typing 'Debug.print CustomerCode' in the 'Immediate Window'. (To open and close the Immediate Window press Ctrl-G.) For debugging this problem you can also try Thanks for your help as I appreciate it very much. In the form called Item Subform , I have a combo box that uses both fields from the table L-Property-ClassList (see below).

Thanks, Nick Attached Files Line Plan.mdb (864.0 KB, 142 views) Nevsky78 View Public Profile Find More Posts by Nevsky78

01-24-2011, 04:22 AM #2 JANR Newly Registered weblink as third and fourth column. in the subform area. Linq ;0)> CyberCowView Member Profile Feb 26 2013, 11:00 AM Post#7UdderAccess Admin + UA RulerPosts: 19,543Joined: 27-April 02From: Upper MII strongly agree with missinglinq where the use of Reserved Words is

It's not clear because the original poster did not identify the original error(s), only "i get different errors everytime i try it." Jasmineeyes, I think you were really close originally. Works like a treat now. How do I add a node ID as class to the tag? http://3rdm.org/ms-access/ms-access-like-not-working.php Is this even possible Dlookup with 2 criteria Help with DLookup/ I'm stumped!

Maybe Shipment_Terms is the field as JR included it in the DLookup() vbaInet View Public Profile Find More Posts by vbaInet

01-24-2011, 05:44 AM #9 Maybe put it on the next controls got focus event? Then the code would simply be: Me!txtState = Me!cboZipCheck.Column(2) Me!txtCity = Me!cboZipCheck.Column(3) -- cu Karl ********* Access-FAQ (German/Italian): http://www.donkarl.com Edited by Karl DonaubauerMVP Thursday, March 14, 2013 3:57 PM line breaks

Maybe it's not called ShipmentID but it is a field that distinctly identifies each Shipment record.

I think I misworded it since the Dlookups are not actually in the Code but are control sources for a textbox. Do you know how I would code this? Nevsky78 View Public Profile Find More Posts by Nevsky78 01-24-2011, 06:38 AM #15 JANR Newly Registered User Join Date: Jan 2009 Location: Norway Posts: 1,618 Thanks guys, Nick Nevsky78 View Public Profile Find More Posts by Nevsky78 01-24-2011, 05:57 AM #11 vbaInet AWF VIP Join Date: Jan 2010 Location:

If that's not the case then you have to use the Column property to get the zip codes from the combo box. Then it should work, if you're trying this when opening, the recordset is probably not loaded. All rights reserved.Unauthorized reproduction or linking forbidden without expressed written permission. his comment is here Connect with top rated Experts 23 Experts available now in Live!

NeoPa, sorry but im pretty new to this so i dont really understand what you meant by the inner join link. I checked the original database, same thing. If that is, indeed, the name of a Field, everything else aside, you simply have to change that before proceeding any further! Posts: 26,373 Thanks: 0 Thanked 2,403 Times in 2,372 Posts Re: DLookup not working Quote: Originally Posted by JANR a pain in the b***.

nt