Selecting an item in a combobox...in Access


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Selecting an item in a combobox...in Access

  1. #1
    Join Date
    Jun 2004
    Location
    Houston area
    Posts
    557

    Selecting an item in a combobox...in Access

    Is there any way to force the selection of one combobox when another is clicked?

    What I'm trying to do is have the user select an item in a combobox and have the OTHER combo box automatically revert to .ListIndex(0) when the first combobox is clicked. You can do this in VB by just setting the .ListIndex property but you can't do this in Access. Anybody have any suggestions?

    L
    A balanced diet is a cookie in each hand.

  2. #2
    Join Date
    Jun 2004
    Location
    Pakistan
    Posts
    292
    In your form, have you second dropdownlist change its value depending on the first dropdown (did this a long time ago when learning ACCESS), I dont exactly remember how to do that but it is doable. then make your second dropdown required in the table which will automatically make the second one required.
    new to programming but getting ther

  3. #3
    Join Date
    Jun 2004
    Location
    Houston area
    Posts
    557
    I dont exactly remember how to do that but it is doable
    Yes, well, that's the part I NEED!

    I've been an Access Programmer for a long time....but more recently a VB programmer. Sometimes I like VBA a LOT better than straight VB but TODAY I like VB better!

    L
    Last edited by Laurel; 03-23-2005 at 06:52 PM.
    A balanced diet is a cookie in each hand.

  4. #4
    Join Date
    Mar 2005
    Posts
    7
    You are on the right track, but the combobox properties are different for VBA. Try the following:

    Code:
    Private Sub cboTest1_AfterUpdate()
    
        Me!cboTest2.Value = Me!cboTest2.ItemData(0)
    
    End Sub
    After the first combobox (cboTest1) is updated, the second combobox (cboTest2) will automatically change to the first value (index 0) in its list.

  5. #5
    Join Date
    Jun 2004
    Location
    Houston area
    Posts
    557

    ME LOVES THE GORTHOG!


    Thanks, EVER SO MUCH, gorthog! I tried all SORTS of combinations of things but just couldn't get the **** thing to work!

    L
    A balanced diet is a cookie in each hand.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center