Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2009
    Posts
    85

    Unanswered: Turn Event Procedure on off w/Code

    I have a form with texts boxes and comboboxes, some have event procedures behind them, is there a way to turn an E.P on and off with code behind a command button or check box. I have looked in my begining vba books and googling but no luck, Thanks

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    Can you explain a little more please;

    Are you trying to run an event at a certain time or not depending on other data?

    Please ellaborate...
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    No - just test your condition in you code:
    Code:
    Sub button_click
    If mycondition = true then
    
    
    ...
    
    End if
    
    End Sub
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Apr 2009
    Posts
    85
    Thanks for responding

    In suto code would it be

    If mycontrol.mycondition = "True" Then
    mycontrol.mycondition = "False"

    ElseIf mycontrol.mycondition = "False" Then (To turn back on)
    mycontrol.mycondition = "True"

    where mycontrolmycondition is a particular event like On Lost Focus
    Last edited by Timothyl; 06-05-09 at 15:30.

  5. #5
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    No - please explain what you are trying to do.
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  6. #6
    Join Date
    Apr 2009
    Posts
    85
    I have a search form with multiple txtboxes and comboboxes, on different controls I have different event procedures that fire in different ways e.g on lost focus, on enter ect..., Depending on what Im doing it. Sometimes it a sright search form other times I use it to re enter demo equipment back in to our database. It would be avantages to turn particular E.P off then back on, given the tasks at hand.
    Last edited by Timothyl; 06-05-09 at 17:31.

  7. #7
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Good greif! There is so much wrong with this, I don't know where to start.

    ONE
    If mycontrol.mycondition = "True" Then
    mycontrol.mycondition = "False"

    ElseIf mycontrol.mycondition = "False" Then (To turn back on)
    mycontrol.mycondition = "True"

    Define: mycondition.

    Seems like you just want to lock the control?

    There is much confusion on what it is you are really after here...

    TWO
    Define: sright search

    THREE
    Don't try to use one form as a search criteria screen and a data entry screen. Just make two forms instead.

    FOUR
    You cannot disable event procedures. You can only code them to do nothing if certain conditions are met.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  8. #8
    Join Date
    Apr 2009
    Posts
    85
    Your responce made me laugh, yah, it did'nt work and I have done as you suggested, as I was indeed trying to use my search form as a data entry form.
    In fact the new form dose it's job much better then trying to use the orignal search form in a dual capacity. Thanks for your responce. Tim
    Last edited by Timothyl; 06-09-09 at 16:59.

Posting Permissions

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