Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error message (Access XP)

    I have a command button on a form. Function is to close form. I have created it using the command button wizard. In run time I get the following message: The expression On Click you entered as the event property setting produced and error: A problem occurred with "file name" we communicating with the OLE server or ActiveX Control.

    I have redone the button multiple times both manually and with the wizard. I have rebooted.

    I have compared to other buttons doing the same function. I have been unable to spot the problems.

    Any help would be appreciated. Thank you in advance. Fay

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error message (Access XP)

    Fay,

    Could you please post the code that doesn't work, so we can see if we can spot anything wrong with it.

    Also, post the code that is working. Maybe we can spot the differences.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error message (Access XP)

    The broken code
    Private Sub cmdSwitchboard_Click()
    On Error GoTo Err_cmdSwitchboard_Click


    DoCmd.Close

    Exit_cmdSwitchboard_Click:
    Exit Sub

    Err_cmdSwitchboard_Click:
    MsgBox Err.Description
    Resume Exit_cmdSwitchboard_Click

    End Sub

    The working code

    Private Sub cmdClose_Click()
    On Error GoTo Err_cmdClose_Click


    DoCmd.Close

    Exit_cmdClose_Click:
    Exit Sub

    Err_cmdClose_Click:
    MsgBox Err.Description
    Resume Exit_cmdClose_Click

    End Sub

    Thanks Bryan for looking at this. It is has me confused.

    Fay

  4. #4
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error message (Access XP)

    Fay,

    I can't see any difference in the code.

    The only suggestion I have is to try and repalce

    DoCmd.Close

    with

    DoCmd.Close acForm, Me.Name

    Other than that I'm at a loss.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Error message (Access XP)

    Hi Fay,
    Is it possible that you have a missing reference for ADO? By default, the switchboard uses ADO with Access XP - it used DAO previously. Just a hunch.
    Wendell

  6. #6
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error message (Access XP)

    That didn't work. I redid the form and the button works on that form.
    Thanks for trying.

    Fay

  7. #7
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error message (Access XP)

    I am using a custom not the built in switchboard. I redid the form and the button works on that form.
    Thanks for trying.

    Fay

Posting Permissions

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