Dlookup 2001 Error
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 DLookup dlookup error handling I get Error 2001 - says I cancelled previous operation. Huh? P: n/a Richard Hollenbeck
Dlookup Error 3075
I got this: "Error 2001 You cancelled the previous operation" with this: Private Sub courseCode_GotFocus() Dim myDLookupResults As String myDLookupResults = DLookup("courseID",
Dlookup Error 2471
"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 think I
Access Dlookup Error
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 this? Is there dlookup #type error 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"
message "you have cancelled the previous operation" run time error 2001 when I use the following dlookup function dim blp as string blp = dlookup("[specialty]","operators","[init] ="&forms![anyform]![field]" dlookup null error I have evencreated a new unbound form with no other code and still access dlookup syntax receive this message. Any help appreciated -- Mike Guest, Nov 24, 2004 #1 Advertisements Allen Browne Guest The error indicates that one of the 3 arguments for DLookup() is not correct. If init is a Number type field (not a Text type field), try: Dim strWhere As String Dim blp as Variant https://bytes.com/topic/access/answers/199606-dlookup-i-get-error-2001-says-i-cancelled-previous-operation-huh strWhere = "[init] =" & forms![anyform]![field] blp = DLookup("[specialty]", "operators", strWhere) If it is a Text type field, you need extra quotes: strWhere = "[init] =""" & forms![anyform]![field] & """" -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Mike" <> wrote in message news:... >I continually get the message http://www.pcreview.co.uk/threads/dlookup-run-time-error-2001.1642064/ "you have cancelled the previous operation" >run > time error 2001 when I use the following dlookup function > > dim blp as string > blp = dlookup("[specialty]","operators","[init] > ="&forms![anyform]![field]" > > I have evencreated a new unbound form with no other code and still receive > this message. > > Any help appreciated > -- > Mike Allen Browne, Nov 24, 2004 #2 Advertisements Guest Guest Thank you, field is text, and the qoutation marks worked "Allen Browne" wrote: > The error indicates that one of the 3 arguments for DLookup() is not > correct. > > If init is a Number type field (not a Text type field), try: > Dim strWhere As String > Dim blp as Variant > strWhere = "[init] =" & forms![anyform]![field] > blp = DLookup("[specialty]", "operators", strWhere) > > If it is a Text type field, you need extra quotes: > strWhere = "[init] =""" & forms![anyform]![field] & """" > > -- > Allen Browne - Microsoft MVP. Perth, Western Australia. > Tips for Access users - http://allenbrowne.com/tips.html > Reply to group, rather than allenbrowne at mvps dot org. > > "Mike" <> wrote in message > news:
Join INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join http://www.tek-tips.com/viewthread.cfm?qid=1044975 Tek-Tips Forums! Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, dlookup error coursework and thesis posting is forbidden.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. Microsoft: Access Modules (VBA dlookup 2001 error Coding) Forum at Tek-Tips HomeForumsProgrammersDBMS PackagesMicrosoft: Access Modules (VBA Coding) Forum DLookup + Runtime Error 2001 "You cancelled Previous Operation thread705-1044975 Forum Search FAQs Links MVPs DLookup + Runtime Error 2001 "You cancelled Previous Operation DLookup + Runtime Error 2001 "You cancelled Previous Operation swk003 (IS/IT--Management) (OP) 18 Apr 05 05:28 I am currently getting Runtime Error 2001 "You cancelled Previous Operation, when trying to run below DLookup(). I have checked all table field speelings etc. [AbbotBoxNumber] is Text datatype and this I believe is where I am getting the problem as have tested the procedure with number datatypes and it works fine. Can somebody point me the right way as to the correct syntax?thanks SWK003Private Sub txt_AbbotBoxNumber_BeforeUpdate(Cancel As Integer)Dim FoundDuplicateABN As StringDim Criteria3 As StringDim Msg8 As String, Style8 As Integer, Title8 As StringDim Msg9 As String, Style9 As Integer, Title9 As StringStatic subCalls3 As IntegerCriteria3 = "[AbbotBoxNumber] =" & Me!txt_AbbotBo