Results 1 to 3 of 3
  1. #1
    orcinus is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    67

    Activating A Drop Down Box Via Code

    I have a drop down box that contains member names. When a member name is selected, it triggers some code that is set to kick off on the After Update event. The Combo box then becomes disabled and the user then does various other actions which can include saving the record they created.

    Once they have saved the record, the Combo Box becomes enabled again and they have the option of re-selecting the same member if they wish to add a new record.

    However, I figure it would be nice if they didn't have to reselect that same member by clicking down on the drop box (or having to go from keyboard to mouse to type the name in the combo box). They could keep using the mouse and click a button that enters the same member they just saved a record for.



    So, there is a public variable that already exists for the associate and I have added that to the command button. However, I'm not sure how to "kick it off".

    Right now, I click the command button and the same member appears in the combo box. But nothing happens. I need some code that imitates a selection action using the Combo Box's drop down feature.

    Note: Clicking the command button and then giving the combo box the focus and hitting enter won't do it. It looks like a selection action has to take place in order for the Update event to kick off..

    Thanks for any help..

    The beginning of my code:

    Private Sub cmd_renter_same_assoc_Click()
    Me.cbo_assoc_id = str_assoc_id_public
    End Sub

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    try using me.requery after your Me.cbo_assoc_id = str_assoc_id_public statement. If your combo box is unbound and you are using it as a criteria to find a record you'll need to requery the results (or goto a new record)

  3. #3
    orcinus is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    67
    Quote Originally Posted by rpeare View Post
    try using me.requery after your Me.cbo_assoc_id = str_assoc_id_public statement. If your combo box is unbound and you are using it as a criteria to find a record you'll need to requery the results (or goto a new record)
    This doesn't work for what I want. It did lead me to think about another way to go about essentially the same thing. After I set the value of the combo box, I just called the code that happens after the "After Update" event of the combo box..

    I should have thought of that before, seems obvious now; but got kinda stuck into thinking it should work exactly how I do it with the mouse..

    Anyway thanks for the assist!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 09-26-2011, 06:38 AM
  2. Buttons activating on form startup
    By howieyo in forum Forms
    Replies: 0
    Last Post: 06-13-2011, 06:48 PM
  3. Replies: 6
    Last Post: 05-11-2011, 02:24 PM
  4. Word code in Access - How to modify my current code
    By Alexandre Cote in forum Programming
    Replies: 0
    Last Post: 11-15-2010, 08:26 AM
  5. drop down issues
    By gromit95 in forum Access
    Replies: 3
    Last Post: 07-21-2008, 08:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums