Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2004
    Posts
    100

    Unanswered: error handler in event from_current

    Hi,

    can it be that access doesn't allow an error handler code in it's form_current event? Everytime I code something like

    Private Sub Form_Current()
    On Error GoTo Err_Form_Current

    Exit_Form_Current:
    Exit Sub

    Err_Form_Current:
    MsgBox Err.Number & " " & Err.DESCRIPTION
    Resume Exit_Form_Current
    end sub

    the error handler is being removed the next time I open the database.
    Any ideas?
    I need to catch the error 3165 and don't know how...
    if err.number = 3165 then ... doesn't work since its always being removed...
    please help !!
    Pregards Proximus

  2. #2
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    As far as I know Access never removes any part of your code from your project. Are you sure you save your code before running?
    ghozy.

  3. #3
    Join Date
    Apr 2004
    Posts
    100
    of course i do !

  4. #4
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    don't be mad at me . forexample I use docmd.close with NoSave option. so whenever I close my form any unsaved change in my project goes to void. I do that alot. another option is might be your error messages somehow suppressed? open a new mdb file try same code there to see if it is working in a fresh project.
    ghozy.

  5. #5
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    If you want a form level error handler then uswe the Error Method of the form ...
    Back to Access ... ADO is not the way to go for speed ...

  6. #6
    Join Date
    Apr 2004
    Posts
    100
    @ghozy: sorry it was not meant to be offense!
    I've tried your suggestion with a new .mdb file.
    The result is, that access doesn't remove the code. However in my project it does! Could that be because it's an event in a subform? Any ideas?

  7. #7
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    did you try to open subform alone and write code and save it? (I'm afraid to ask anything now ) sometimes when you modify subforms in main form they fail to save without warning or won't save.
    ghozy.

  8. #8
    Join Date
    Apr 2004
    Posts
    100
    lol. I can't believe it....
    @ghozy: I opend the subform alone, just as you've sayed. Then coded again. Saved. Closed the DB. Opened it again. Run the main form.
    And for some f... reason it works now!
    I don't know if I should be happy now or if I should cry ...
    Anyways. Thank you very much !!!
    Regards Proximus

  9. #9
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    no problem.
    ghozy.

Posting Permissions

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