Results 1 to 11 of 11
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form On Current Event not working for me? (A2k (9.0.3821) SR-1)

    Form On Current Event not working for me?

    A2k (9.0.3821) SR-1

    I have form frm_TOC_BP_ACD that opens to an empty record set. A Lookup combo allows the operator to lookup and display a full permit records one at a time.

    I have a button on the form frm_TOC_BP_ACD that displays all the permit records in the database in datasheet view in decending Permit Numner sequence.

    The operator can click on any permit in the datasheet view and the record source is changed for frm_TOC_BP_ACD.

    Every thing works perfect.

    I have since added an On Current event to frm_TOC_BP_ACD

    Now when I click a permit number in the datasheet view form I get the following message:

    Runtime error 2450 - Can

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Form On Current Event not working for me? (A2k (9.0.3821) SR-1)

    I got a little confused, as I'm not sure where the code is executing. Is it in a subform?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Form On Current Event not working for me? (A2k (9.0.3821) SR-1)

    If the form that contains the double click event on Permits is frm_TOC_BP_ACD, then change the line that sets the recordsource to this:

    Me.RecordSource = strSQL
    Charlotte

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form On Current Event not working for me? (A2k (9.0.3821) SR-1)

    Hi Charlotte

    Find attached OnCurrent.mdb that demonstrates error 2450 described in previous post.

    Click Open Form, and then double click on CustomerID of your choice.

    Works perfectfully.

    Now envoke zfrm_Customer_Columnar On Current [Event Procedure] and test the double click on CustomerID

    Runtime error 2450 - Can
    Attached Files Attached Files

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Form On Current Event not working for me? (A2k (9.0.3821) SR-1)

    Sorry, but I don't get an error on it. When I double click on a customerID in the datasheet, it goes back to the first form with that record showing. Have you done a detect & repair on Access? It sounds like your installation has a problem.
    Charlotte

  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form On Current Event not working for me? (A2k (9.0.3821) SR-1)

    Hi Charlotte

    The db I sent works as is. Did you envoke the On Current event? This is when I get the errror.

    Did the repair, imported in a new db, same problem.

    John

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Form On Current Event not working for me? (A2k (9.0.3821) SR-1)

    Sorry, but I don't understand what you're trying to do. Why do you *want* to invoke the OnCurrent event? That also works on my machine. When I uncomment the OnCurrent code, I see a messagebox saying "On Current". I do not, however, see an error of any sort.
    Charlotte

  8. #8
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form On Current Event not working for me? (A2k (9.0.3821) SR-1)

    Hi Charlotte

    Sorry for not properly describing my problem.

    Find attached OnCurrent.mdb that demonstrates error 2450 described in previous post.

    1. Click Open Form, and then double click on CustomerID of your choice.

    Runtime error 2450 - Can
    Attached Files Attached Files

  9. #9
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Form On Current Event not working for me? (A2k (9.0.3821) SR-1)

    Hi John,
    Your problem appears to be your docmd.close which seems to be closing the columnar form rather than the datasheet form (possibly your oncurrent code is changing the focus?), hence the "Can't find form" message.
    If you change it to:
    DoCmd.Close acForm, Me.Name
    then it seems to be ok, but you might want to add a routine to make sure that the columnar form is open, and if not, open it.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  10. #10
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form On Current Event not working for me? (A2k (9.0.3821) SR-1)

    Hi Rory

    Yes it works, thank you

    What would the routine look like to make sure that the columnar form is open, and if not, open it.

    Thanks again, John

  11. #11
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Form On Current Event not working for me? (A2k (9.0.3821) SR-1)

    Take a look at <!post=acc, 2733>Post 2733<!/post> - Charlotte to the rescue!
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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