Results 1 to 5 of 5
  1. #1
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Combo Boxes (2K SR-1)

    1. <LI>The bound column in a combo box defines the column number (field) in the row source of the combo box - it may be either a table or a query.
      <LI>The combo box on a form controls what you see on the form - definitions in the table design have no impact on the form. By the same token, whatever you define in table design as a lookup for a field are not affected by anything you set up on the form.
      <LI>To implement synchronized combo boxes requires that you refresh the data in the second combo box after you change the value in the first, and that involves code. You don't mention it, but that could be what is making things misbehave for you.
    Wendell

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Brookline, Massachusetts, USA
    Posts
    606
    Thanks
    17
    Thanked 0 Times in 0 Posts

    Combo Boxes (2K SR-1)

    <P ID="edit" class=small>(Edited by charlotte on 13-Mar-03 19:57. to activate links to posts)</P>I am trying to resolve some problems originally discussed in Post: <!post=231271,231271>231271<!/post>.
    1. When I specify the Bound Column in a Combo Box, is it the column # of the query or the underlying table?
    2. Which Bound Column property controls? The one in the Table under Lookup or the one on the Form? These 2 questions relate to seeing the Index displayed instead of the actual value of the Combo Box.
    3. I am still having trouble synchronizing the second Combo Box with the first. I did use Drew Witka's (Post <!post=231276,231276>231276<!/post>) suggested Table structure but my Query must be screwed up.
    It is a 2-table query joined on CatID. Here is the SQL:
    SELECT DISTINCTROW tblCategories.CategoryID, tblSubCat.SubcatID, tblSubCat.Subcategory
    FROM tblCategories INNER JOIN tblSubCat ON tblCategories.CategoryID = tblSubCat.CategoryID; *** Note slight changes in table and field names. ***
    Thanks for any suggestions.
    Howard

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Brookline, Massachusetts, USA
    Posts
    606
    Thanks
    17
    Thanked 0 Times in 0 Posts

    Re: Combo Boxes (2K SR-1)

    Thanks for the clarification on Bound Column. In my original thread I did post the following:

    "...However, I am having trouble getting the second combo box to update when the first is changed. I followed your example and put the following code in the On Click event of the Category :
    Private Sub Form_Click()
    SpecificSubject1.Requery .......(SpecificSubject1 is the name of the the SubCat combo box on the Form.)
    End Sub
    I used Requery instead of Refresh after reading the Help files. This is a single-user db.
    Any suggestions on why the subcategory doesn't update when I select the second item in the Category Combo Box?"

    This seems pretty simple. Where did I go wrong?

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Combo Boxes (2K SR-1)

    Usually you would put the Requery in the AfterUpdate event of the 1st combobox.
    The SELECT of the 2nd combobox should include a WHERE clause that references the 1st combobox's field.
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Brookline, Massachusetts, USA
    Posts
    606
    Thanks
    17
    Thanked 0 Times in 0 Posts

    Re: Combo Boxes (2K SR-1)

    Belated thanks for the post. I double checked the SQL and found an error. I also had to add another Requery. This one to the On Current event of the form. It ensures that the data is requeried when I move to a new record. Before I did that, when I moved to the next record the second combo box was showing the data from the previous record.
    Thanks again for your help.
    Howard

Posting Permissions

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