Dlookup Error 2001
Contents |
+ Ask a Question Need help? Post your question and get tips & solutions from a community of 418,497 IT Pros & Developers. It's quick & easy. in access runtime error 2001 dlookup DLookup I get Error 2001 - says I cancelled previous operation. Huh? P: n/a Richard dlookup error handling Hollenbeck I got this: "Error 2001 You cancelled the previous operation" with this: Private Sub courseCode_GotFocus() Dim myDLookupResults As String myDLookupResults dlookup error 3075 = DLookup("courseID", "courses", "criteria= '" & Forms!frmSelectCourses!courseDescription & "'") lblMessages.Caption = "You are working on " & myDLookupResults 'insert myDLookupResults into a label called lblMessages End Sub The debugger correctly reads the record, so I don't
Dlookup Error 2471
think I have the wrong code, or maybe I do. Any ideas? Nov 13 '05 #1 Post Reply Share this Question 2 Replies P: n/a PC Datasheet The only possible problem I see with what you posted is your use of "Criteria" as a field name. It may be a reserved word. Try changing it to something else and see what happens. <<'insert myDLookupResults into a label called lblMessages>> What is dlookup #type error this? Is there more code you did not post? -- PC Datasheet Your Resource For Help With Access, Excel And Word Applications re******@pcdatasheet.com www.pcdatasheet.com "Richard Hollenbeck"
Community Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools dlookup null error Rate Thread Display Modes 01-13-2011, 01:49 AM #1 lynxbci Newly Registered User
Access Dlookup Syntax
Join Date: Nov 2007 Posts: 70 Thanks: 6 Thanked 1 Time in 1 Post Error 2001 with Dlookup function Hi I have the following code in my form Dim varX As Variant varX = DLookup("[Product Description]", "tblproductlist", "[Product Code] = " & Me!txt_Product) The expr is correct, there is a field called https://bytes.com/topic/access/answers/199606-dlookup-i-get-error-2001-says-i-cancelled-previous-operation-huh Product Description in tblproductlist the table is correct, there is a table called tblproductlist The field is correct, there is a field called product code in tblproductlist The me!txt_product is returning the correct data So why is it giving me the error 2001, which means the syntax is incorrect somewhere i beleive? thanks in advance lynxbci View Public Profile Find More Posts by lynxbci http://www.access-programmers.co.uk/forums/showthread.php?t=203784 01-13-2011, 01:59 AM #2 MStef Newly Registered User Join Date: Oct 2004 Location: Zagreb - Croatia Posts: 2,251 Thanks: 0 Thanked 80 Times in 75 Posts Re: Error 2001 with Dlookup function If the Product Code is a string (txt), try next: ...................."[Product Code] = """ & Me!txt_Product & """") MStef View Public Profile Find More Posts by MStef 01-13-2011, 02:16 AM #3 lynxbci Newly Registered User Join Date: Nov 2007 Posts: 70 Thanks: 6 Thanked 1 Time in 1 Post Re: Error 2001 with Dlookup function 2001: Not the most useful error message Thankyou, working perfectly now lynxbci View Public Profile Find More Posts by lynxbci « Previous Thread | Next Thread » Thread Tools Show Printable Version Email this Page Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Rate This Thread Excellent Good Average Bad Terrible Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Access World Access World News Site Suggestions Introduce Yourself The Watercooler Microsoft Access Discussion General
Technology and Trends Enterprise Architecture and EAI ERP Hardware IT Management and Strategy Java Knowledge Management Linux Networking Oracle PeopleSoft Project and Portfolio Management SAP SCM http://database.ittoolbox.com/groups/technical-functional/access-l/access-2003-dlookup-error-2001-3682140 Security Siebel Storage UNIX Visual Basic Web Design and Development Windows < Back CHOOSE A DISCUSSION GROUP Research Directory TOPICS Database Hardware Networking SAP Security Web Design MEMBERS Paul_Pedant MarkDeVries DACREE Inside-ERP MacProTX VoIP_News Inside-CRM PCMag maxwellarnold I_am_the_dragon Michael Meyers-Jouan TerryCurran Chris_Day Andrew.S.Baker JoeTorre bracke Locutus Ramnath.Awate DukeGanote Craig Borysowich Dennis Stevenson Richard mircea_luca Nikki Klein AbhaiTripathi knowscognosdoi Clinton Jones blrvenkat dlookup error Iqbalyk bluesguyAZ59 COMPANIES Webroot Dell Software Oracle Service Max View All Topics View All Members View All Companies Toolbox for IT Topics Database Groups Ask a New Question Microsoft Access The Microsoft Access group is for the discussion of issues that arise during the implementation, configuration, administration, or daily use of MS Access. Home | Invite Peers | More Database Groups Your dlookup error 2001 account is ready. You're now being signed in. Solve problems - It's Free Create your account in seconds E-mail address is taken If this is your account,sign in here Email address Username Between 5 and 30 characters. No spaces please The Profile Name is already in use Password Notify me of new activity in this group: Real Time Daily Never Keep me informed of the latest: White Papers Newsletter Jobs By clicking "Join Now", you agree to Toolbox for Technology terms of use, and have read and understand our privacy policy. Access 2003 DLookup error 2001 A. Sale asked Aug 7, 2010 | Replies (2) I have two forms: frmALL (continuous form) and frmNEW (single form). I have a command button on frmALL that calls up frmNEW in edit mode using the following code: Private Sub cmdEDIT_Click() DoCmd.OpenForm "frmNEW" Forms!frmNEW!txtFORMTYPE = "edit" Forms!frmNEW.Caption = "Edit Order" Forms!frmNEW!txtTRANSACTIONSID = Me.txtTRANSACTIONSID Forms!frmNEW!cmbNAME = Me.cmbCONTACTID Forms!frmNEW!listCOMPANYID = DLookup("COMPANYID", "tblCONTACTS", "listCOMPANYNAME = '" & listCOMPANYID & "'") Forms!frmNEW!txtTRANSACTIONDETAILS = Me.txtTRANSACTIONDETAILS End Sub The text boxes are all correctly filled in on frmNEW but I get error '2001