Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Sep 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It has been several years since I last worked on a database, so I'm having a bit of trouble getting back into the swing of things. Anyhow...I have a combo box that lists Manufacturers of RVs. Then I have another combo box that lists all the Models of RVs. I want to be able to select the Manufacturer from the first combo box, and have it show me just the Models that are under that Manufacturer in the next combo box. How can I accomplish this?

    I have two tables set up:

    Manufacturer table
    ManuID
    ManufactName

    Model table
    ModelID
    ModelName
    ManuNum

    I took the ManuID beside the ManufactName and put that same number in the ManuNum field next to each ModelName that corresponds to that manufacturer. I then made a Relationship from one-to-many (ManuID to ManuNum). Is this the right way to go about this?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='tdbear' post='792756' date='10-Sep-2009 14:27']It has been several years since I last worked on a database, so I'm having a bit of trouble getting back into the swing of things. Anyhow...I have a combo box that lists Manufacturers of RVs. Then I have another combo box that lists all the Models of RVs. I want to be able to select the Manufacturer from the first combo box, and have it show me just the Models that are under that Manufacturer in the next combo box. How can I accomplish this?

    I have two tables set up:

    Manufacturer table
    ManuID
    ManufactName

    Model table
    ModelID
    ModelName
    ManuNum

    I took the ManuID beside the ManufactName and put that same number in the ManuNum field next to each ModelName that corresponds to that manufacturer. I then made a Relationship from one-to-many (ManuID to ManuNum). Is this the right way to go about this?[/quote]
    Firstly i wouldn't have called one field ManuID and its corresponding field in the other table as ManuNum, i would have named them both ManuID.
    To answer your question, yes you are going about it the right way.
    The first combo box (call it ComboManufacturer) would be based on the Manufacturer table with both fields (only you would hide the ManuID from view).
    Then base the second combo ( call it ComboModel) on Model Table with all 3 fields in there. Hide ModelID and ManuNum but put a criteria on ManuNum = ComboManufacturer.Column(0).
    When you exit the comboManufacturer put in the AfterUpdate event of this combo requery the Model combo.

  3. #3
    New Lounger
    Join Date
    Sep 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow

    [quote name='patt' post='792757' date='09-Sep-2009 21:36']Firstly i wouldn't have called one field ManuID and its corresponding field in the other table as ManuNum, i would have named them both ManuID.
    To answer your question, yes you are going about it the right way.
    The first combo box (call it ComboManufacturer) would be based on the Manufacturer table with both fields (only you would hide the ManuID from view).
    Then base the second combo ( call it ComboModel) on Model Table with all 3 fields in there. Hide ModelID and ManuNum but put a criteria on ManuNum = ComboManufacturer.Column(0).
    When you exit the comboManufacturer put in the AfterUpdate event of this combo requery the Model combo.[/quote]

    OK. I tried what you suggested, but I get an "undefined function cmbManufacturer.column in expression". What does this mean?

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='tdbear' post='792758' date='10-Sep-2009 16:04']OK. I tried what you suggested, but I get an "undefined function cmbManufacturer.column in expression". What does this mean?[/quote]
    Try taking off the .column(0), it should be the same as cmbManufacturer.

  5. #5
    New Lounger
    Join Date
    Sep 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='patt' post='792760' date='09-Sep-2009 22:40']Try taking off the .column(0), it should be the same as cmbManufacturer.[/quote]
    I took off the .column(0), but now when I choose the manufacturer there is nothing showing up in the second combo box.

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='tdbear' post='799912' date='26-Oct-2009 15:22']I took off the .column(0), but now when I choose the manufacturer there is nothing showing up in the second combo box. [/quote]
    Any chance of seeing a compacted zipped database of what you are trying to do.

  7. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    [quote name='tdbear' post='799912' date='26-Oct-2009 15:22']I took off the .column(0), but now when I choose the manufacturer there is nothing showing up in the second combo box. [/quote]
    You need some code to force the second combo to be requeried every time you make a selection in the first.
    So in the after update event for combomanufacturer put this:
    me.ComboModel.requery
    Regards
    John



Posting Permissions

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