Ms Access Error You Cancelled Previous Operation
Custom Search UtterAccess Forums>Microsoft® Access>Access Errors + Error Handling "You canceled the previous operation" Forum HomeSearchHelpUA Messages|-- UtterAccess.com NewsAccess Knowledge Center|-- Access Code Archive|-- Access Knowledgebase / FAQ|-- Access TutorialsMicrosoft® Access|-- Local Access User Groups (AUGs)|-- Interface Design|-- Access Q and A|-- Access Tables + Relationships|-- Access Queries|-- Access Forms|-- Access Reports|-- Access Macros|-- Access Modules|-- Access Date + Time|-- Access Errors + Error Handling|-- Access Built-in Functions|-- Access Searching + Data Mining|-- Access Records|-- Access Security|-- Access Automation|-- Access Database Container|-- Tool bars, Menu bars + Ribbon|-- Access Services (Web Databases)|-- Access Data Access Pages (Deprecated)|-- Access Data Projects - ADP|-- Access Runtime, Packaging & DeploymentAnd More...|-- Microsoft SQL Server|-- SQL Server Reporting Services|-- Microsoft SharePoint|-- Microsoft Internet Explorer|-- Visual Basic 6 and Earlier|-- Visual Basic 2003 and Later|-- ASP and VBScript|-- Web Development|-- PHP, Perl, MySQL and Postgres|-- Other Database Engines|-- BI Tools and Applications|-- JAVA and C#|-- GraphicsMicrosoft® Office|-- Microsoft Excel|-- Microsoft Excel FAQs|-- Microsoft Word|-- Microsoft Outlook|-- Microsoft PowerPoint|-- Microsoft FrontPage/Exp. Web|-- Other Microsoft ProductsPC|-- Network Issues|-- Q & A - Hardware|-- Q & A - Software|-- Q & A - Other PC|-- Virus + Security DiscussionUtterAccess Odds and Ends|-- General Chat|-- Q & A - UtterAccess.com Forums|-- Q & A - Access Wiki Options comalleyView Member Profile Sep 17 2004, 09:06 AM Post#1Posts: 2Joined: 24-March 04This error is being generated
Posts Search 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 Rate Thread Display Modes 04-14-2003, 03:04 PM #1 R2D2 Member Join Date: Jul 2002 Posts: 62 Thanks: 0 Thanked 1 Time in 1 Post Error 2001: "You cancelled the previous operation" I have some code in a command button on a form that generates Error 2001: "You cancelled http://www.utteraccess.com/forum/you-canceled-previous-o-t543123.html the previous operation." I've searched this forum for fixes, and the only suggestion I found which might work for me is creating a new database and importing everything from the current one. I've tried this and it doesn't work - I get the same problem. So I don't think it's being caused by a corrupt database. Here's my code: Private http://www.access-programmers.co.uk/forums/showthread.php?t=45988 Sub Command37_Click() On Error GoTo Command37_Click_Error DoCmd.SetWarnings False DoCmd.OpenQuery "qryCheckImportedTotals" If (DCount("*", "tblSSTotalsExceptions", "(([tblSSTotalsExceptions].[Year] = [tblImportedTest].[Year]) AND ([tblSSTotalsExceptions].[Payno] = [tblImportedTest].[Pay No]) AND ([tblSSTotalsExceptions].[Week] = [tblImportedTest].[Week No]))") > 0) Then If (MsgBox("The totals listed on the Excel spreadsheets don't match the sum total of the individual records. Would you like to see tblSSTotalsExceptions?", vbYesNo + vbQuestion) = vbYes) Then DoCmd.OpenTable "tblSSTotalsExceptions" End If End If DoCmd.SetWarnings True Command37_Click_Exit: Exit Sub Command37_Click_Error: MsgBox Err.Description, vbCritical, "Error #: " & Err.Number Resume Command37_Click_Exit End Sub When I Debug, the problem registers on the "If (DCount ..." line. Does anyone know what's causing this problem, and how I might fix it? thanks! R2D2 View Public Profile Find More Posts by R2D2 04-14-2003, 03:14 PM #2 Rich Guest Posts: n/a Why are you opening "qryCheckImportedTotals" ? 04-14-2003, 03:35 PM #3 R2D2 Member Join Date: Jul 2002 Posts: 62 Thanks: 0 Thanked 1 Time in 1 Post qryCheckImportedTotals is an append query that adds records to tblSSTotalsExceptions. Sometimes it finds records
VBA Code & Other Help Access Help Solved: you canceled the previous operation If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register http://www.vbaexpress.com/forum/showthread.php?26484-Solved-you-canceled-the-previous-operation before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 12 of 12 Thread: Solved: you canceled the previous operation Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 04-29-2009,01:58 PM #1 mpearce View ms access Profile View Forum Posts View Blog Entries View Articles VBAX Contributor Joined Feb 2009 Posts 107 Location Solved: you canceled the previous operation Sorry for the length of this code, but when the below code runs everything up to the export routine is run. when the export routine is run i get: run-time error '2001' you canceled the previous operation. I am not sure why i ms access error am getting that error. Here is my code: Option Compare Database Option Explicit Private Sub btnImport_Click() Dim objdialog As Variant Dim objdialog2 As Variant Dim intresult As Integer Dim yestreferral As String Dim todayreferral As String Dim intresult2 As Integer Dim refdate As String Dim ech_records As Integer Dim ermc_records As Integer Dim mmc_records As Integer Dim mhh_records As Integer Dim stbhc_records As Integer Set objdialog = CreateObject("UserAccounts.CommonDialog") Set objdialog2 = CreateObject("UserAccounts.CommonDialog") Call open_(objdialog, objdialog2, intresult, yestreferral, todayreferral, intresult2) Call deleteReferrals Call import(yestreferral, todayreferral) Call export(refdate, ech_records, ermc_records, mmc_records, mhh_records, stbhc_records) End Sub Sub open_(objdialog As Variant, objdialog2 As Variant, intresult As Integer, ByRef yestreferral As String, ByRef todayreferral As String, intresult2 As Integer) objdialog.Filter = "Text Files|*.txt|All Files|*.*" objdialog.InitialDir = "x:\uhs south tx\referrals" objdialog2.Filter = "Text Files|*.txt|All Files|*.*" objdialog2.InitialDir = "x:\uhs south tx\referrals" Do While intresult = 0 intresult = objdialog.ShowOpen MsgBox "Select a file to continue", vbCritical, "!!ERROR!!" Loop yestreferral = objdialog.FileName MsgBox yestreferral Do While intresult2 = 0 intresult2 = objdialog2.ShowOpen MsgBox "Select a file to continue", vbCritical, "!!ERROR!!" Loop todayreferral = objdialog2.FileName MsgBox todayreferral End Sub Sub deleteReferrals() DoCmd.RunSQL "DELETE UHS Referrals Yesterday.* FROM [UHS Referrals Yesterday];" DoCmd.RunSQL "DELETE UHS Referr