1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access Help: Events/Procedures

Discussion in 'Business Applications' started by hotdiamond, Jan 14, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. hotdiamond

    hotdiamond Thread Starter

    Joined:
    Mar 4, 2004
    Messages:
    161
    I have a form with an option group. One of the options is to “Return to Claims”. When this option is selected, I would like for a text box to pop up so that information can be entered into the text box. If this option is not chosen, then I would like for the text box to remain hidden.

    I am aware that I will need to set up an event. However, I am not familiar with this. Can anyone help me with what I need to do and how to do it? I will especially need help writing the code.

    Thanks.
     
  2. rconverse

    rconverse

    Joined:
    Sep 7, 2007
    Messages:
    191
    This can be done with ease.

    Create your text box with the message and in properties set visible to no.

    Then on your option control right click to pull up the on click property, enter event procedure and then click on the "..." button.

    from there you can put in the following:

    Code:
    if me.OptionName. value = true then me.txtBox.visible = true
    Else: me.txtBox.Visible = false
    End if
    
    HTH
    Roger
     
  3. hotdiamond

    hotdiamond Thread Starter

    Joined:
    Mar 4, 2004
    Messages:
    161
    When I right click on the option control, my choices are On Got Focus, On Lost Focus, On Mouse Down, On Mouse Move, On Mouse Up, On Key Down, On Key Up, and On Key Press. It doesn't give me an "On click" option. Should I choose one of the choices listed above to insert the code into?
     
  4. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,767
    You need to use the "After Update" event of the actual "Frame" of the option group, using the number that equates to your "Return to claims" option.
    ie
     
  5. hotdiamond

    hotdiamond Thread Starter

    Joined:
    Mar 4, 2004
    Messages:
    161
    OBP,

    Can you explain exactly what I need to type as my code once I click the "After Update" event?
     
  6. rconverse

    rconverse

    Joined:
    Sep 7, 2007
    Messages:
    191
    This code should still work.

    Code:
    if me.OptionName.value = true then 
    me.txtBox.visible = true
    Else
    me.txtBox.Visible = false
    End if
    
    Of course you will have to change me.OptionName.value to the name of your option and me.txtBox.visible to the name of your textbox.

    Thanks,
    Roger
     
  7. hotdiamond

    hotdiamond Thread Starter

    Joined:
    Mar 4, 2004
    Messages:
    161
    I used that code, but I couldn't get it to work. Everytime I tabbed over to the option group, the VBA code window opened and it said there was an error.
     
  8. hotdiamond

    hotdiamond Thread Starter

    Joined:
    Mar 4, 2004
    Messages:
    161
    The error message said "This command will stop the debugger."
     
  9. rconverse

    rconverse

    Joined:
    Sep 7, 2007
    Messages:
    191
    Can you post your DB?
     
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/671742

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice