Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    386

    Unanswered: Why do I get this message on opening a form "You Cancelled the Previous Operation"

    I am just in the middle of creating a Reminder System to remind me of over due incomplete jobs and have used the following Code on the OnLoad event procedure of a form and everytime i try to open the form to see the reminders, i get this message
    "RunTime error 2001 You have cancelled the Previous Operation"
    This is the code I used:

    Private Sub Form_Load()

    'On Load of the switchboard check Jobs table for any uncompleted jobs

    Dim intStore As Integer

    'Count of uncomplete jobs that are past the Expected Completion Date
    intStore = DCount("[id]", "[booking]", "[ExpectedCompletionDate] <=Now() AND [Complete] =0")

    'If count of uncomplete jobs is zero display switchboard
    'Else display message box detailing amount of jobs
    'and give the user the option as to whether to view these or not.
    If intStore = 0 Then
    Exit Sub
    Else
    If MsgBox("There are " & intStore & " uncompleted jobs" & _
    vbCrLf & vbCrLf & "Would you like to see these now?", _
    vbYesNo, "You Have Uncomplete Jobs...") = vbYes Then
    DoCmd.Minimize
    DoCmd.OpenForm "frmReminders", acNormal
    Else
    Exit Sub
    End If
    End If
    End Sub
    Any help would BE HIGHLY APPRECIATED.
    THANKS
    Emi-UK
    Love begets Love, Help Begets Help

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Two questions:

    Do you have anything going on in this form's Open event?

    Do you have anything going on in the Form Open and Form Load events of frmReminders?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    May 2006
    Posts
    386
    HI Missingling, No I do not have anything going on the forms Open Event and I do not have anything going on the Load Even of frmReminders.
    Emi-UK
    Love begets Love, Help Begets Help

  4. #4
    Join Date
    Mar 2007
    Posts
    277
    You can get that error message is *any* of the parameters for the DCount() function do not exist (ie: misspelled)!
    RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP, ac07, ac10 - WinXP Pro, Win7 Pro
    Please reply to this forum so all may learn.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •