Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2002
    Location
    UK
    Posts
    16

    Unanswered: Event Procedures that Dissapear...

    I have an interesting dilema... In two of my forms, all of the command buttons lost their relating event procedures, the procedure code hasn't gone, neither the link between the command button and the procedure but they just don't work. I am very puzzled as the command buttons havn't been touched since the creation of the forms months ago... I am just wondering out of interest whether anyone else has encountered a similar problem, whether there is anything to stop it happening again or what I have done wrong.

    Many Thanks for any replies...
    "There Are No Problems only Solutions"

  2. #2
    Join Date
    Aug 2002
    Location
    Québec, Canada
    Posts
    109
    This is a problem I have already have. The problem is that is you create a command button named command1 and that you go directly in the code to paste a procedure like sub command1_click, the links will not be done. You'll go to the form, and go create the event, but the code will not be associated.

    To make it works, delete the procedure (event click) not associated, go to the form and use Access to create the code event, the command1_click sub will reappear, now just past the code you deleted in that new procedure.

    The same things happen if you change the name of a control, don't go change the name of the procedure, create with Access that new procedure code and copy paste the old codes

    JefB - hope it helps

  3. #3
    Join Date
    Sep 2002
    Location
    Coventry, Warwickshire, UK
    Posts
    74
    You can also select the command button and then show the properties. Find the On Click property and make sure [Event Procedure] is displayed. Double click the field if it isn't. That should toggle it into view.
    Roger Hampson
    XI - ecs (UK) Ltd

  4. #4
    Join Date
    Aug 2002
    Location
    Québec, Canada
    Posts
    109
    Originally posted by xiecsuk
    You can also select the command button and then show the properties. Find the On Click property and make sure [Event Procedure] is displayed. Double click the field if it isn't. That should toggle it into view.
    Sometimes, even if the On Click procedure is shown, it is not associated. If you click to go for the code, you'll go to the procedure, the name will be recognize, but it will not works when executing, don't get fooled by that, and do that copy and paste method

    It has append to me a couple of times btw

    JefB

  5. #5
    Join Date
    Sep 2002
    Location
    Coventry, Warwickshire, UK
    Posts
    74
    I am assuming that quantumleaders wants to trigger the _Click event associated with the command button when it is selected. Therefore, if the On Click property is set to the actual string "[Event Procedure]", not the name of some other procedure, the _Click event for the command button will be triggered when the button is selected. That is what that setting means.
    Roger Hampson
    XI - ecs (UK) Ltd

  6. #6
    Join Date
    Aug 2002
    Location
    Québec, Canada
    Posts
    109
    Originally posted by xiecsuk
    I am assuming that quantumleaders wants to trigger the _Click event associated with the command button when it is selected. Therefore, if the On Click property is set to the actual string "[Event Procedure]", not the name of some other procedure, the _Click event for the command button will be triggered when the button is selected. That is what that setting means.
    Yes, but this is a particular behavior that can occur with Access, sometime, the [Event Procedure] is written in the event description, and there is the sub in the form code, but, for a particular reason, the code is NO MORE associated with the event button, it is like the code is a separated module. I think it was corrected in Access 2000, but I have encounter that problem a couple of times when changing name of button, and the only way we have found to fix it is to reassociate the code by deleting the SUB, and by recreating it, even if it results by the same sub name and procedure

    Maybe quantum have that problem...

    JefB

  7. #7
    Join Date
    Aug 2002
    Location
    UK
    Posts
    16

    Thank you both...

    Reading both your replies I think I have understood where I went wrong and why the association to my procedures dissappeared, I am sorry that I couldn't have been involved in the discussion... Thanks for paying so much attention to my post, I hope it brings less hassle in the future...
    "There Are No Problems only Solutions"

Posting Permissions

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