Results 1 to 13 of 13
  1. #1
    kiranair is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2016
    Posts
    53

    Cascading combo box

    Hello ,

    I have dependent 4 combo boxes, Eg Category, Name , Price ,Value .
    When i select category(vegetables, fruits ,flowers) It is showing Name drop down related to category then I ll select Name (till now its working fine)
    after I select Name I want Price and value to be selected automatically from the source table related to Name .

    source table(tblAll) contains Category, Name , Price ,Value.



    Category Row source: SELECT DISTINCT tblAll.Category FROM tblAll ORDER BY tblAll.Category;

    cboCategory_AfterUpdate() : Me.CboName.Value = ""
    On Error Resume Next
    CboName.RowSource = "Select tblAll.Name " & _
    "FROM tblAll " & _
    "WHERE tblAll.Category = '" & cboCategory.Value & "' " & _
    "ORDER BY tblAll.Name;"



    This is my Eg data
    I need to generate the value and Price on selecting Name can someone help me !!!!!

    I tried to do the same for Price and Value but it didn't

    Cheers
    Thanks in advance

  2. #2
    kiranair is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2016
    Posts
    53
    Eg
    vegetable Potato 3,00€ Kg

    Flower Rose 15,00€ g

    Fruits Apple 5,00€ Kg

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Is this what you're looking for?

    http://www.baldyweb.com/Autofill.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    kiranair is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2016
    Posts
    53
    yeah its almost same but my situation is different

    tblAll is my source table where the data required to display in combo is stored
    source table(tblAll) contains Category, Name , Price ,Value.

    tblEntry is the table where all the data that is entered in formEntry using combo ll come and sit.

    In the above link it is not saving the data to a table-

    Thanks for your response !!!!!!

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933

  6. #6
    kiranair is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2016
    Posts
    53
    thank you so much for all your replies,

    I tried this code for After update Event for Category, Name , Price by changing Event according to the situation and am getting the desired result,
    just I made 4 combo boxes including name, price and value
    For price and value their ll be only one option that I have to select manually so that ll not be a major oroblem


    cboCategory_AfterUpdate() :
    Me.CboName.Value = ""
    On Error Resume Next
    CboName.RowSource = "Select tblAll.Name " & _ "FROM tblAll " & _ "WHERE tblAll.Category = '" & cboCategory.Value & "' " & _
    "ORDER BY tblAll.Name;"

    Thank you for your precious suggestions
    Cheers!!!

  7. #7
    kiranair is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2016
    Posts
    53
    As the link provided by Ajax.

    I have the same situation like
    tblorders
    when I select product type ,colour ,Product
    Quantity is a text box where I have to fill it .

    but in my case quantity has to be auto fill.
    that is my problem

  8. #8
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    don't understand what you mean by

    but in my case quantity has to be auto fill
    so far as I can see you have not mentioned this before - if you mean an additional combo then just add one in and modify the code you are using to take it into account

  9. #9
    kiranair is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2016
    Posts
    53
    In my case
    tblorders
    when I select product type ,colour is populating the drop down related to Product type, after that I ll select desired colour then I need to auto fill text boxes Product and
    Quantity for that I have the code like this


    Product type Row source: SELECT DISTINCT tblAll.Product type FROM tblAll ORDER BY tblAll.Product type;



    cboProduct type_AfterUpdate() :
    Me.Cbocolour.Value = ""
    On Error Resume Next
    Cbocolour.RowSource = "Select tblAll.Colour,tblAll.Product,tblAll.Quantity " & _ "FROM tblAll " & _ "WHERE tblAll.Product type = '" & cboProduct type.Value & "' " & _
    "ORDER BY tblAll.colour;"

    Private Sub cboColour_AfterUpdate()
    Me.txtProduct.Value = CboColour.Column(1)
    Me.txtQuantity.Value = CboColour.Column(2)
    End Sub


    Everything is working fine in form as desired but in datasheet in colour's place quantity is displayed and colour is not displayed


    something like this
    Product_Type colour Product Quantity
    qwerty 5 xyz 5

  10. #10
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    in colour's place quantity is displayed and colour is not displayed
    you need to check your cbocolour properties

    looks like it should be

    column count=3
    bound column=0
    column widths=2;0;0

    a couple of other things - you appear to have a space in 'Product type' - if so it should be in square brackets. The other thing is you don't need .value - it is the default

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Quote Originally Posted by Ajax View Post
    bound column=0
    Is bound column zero based?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    Is bound column zero based?
    errr - no, should be 1. my bad

  13. #13
    kiranair is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2016
    Posts
    53
    Yup I had typed cboColour Instead of CboColour Bcz of that it was creating some problem .

    Thanks for your Precious suggestion's

    You guys are always their to find my silly mistakes !!!!!!!

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

Similar Threads

  1. Cascading Combo - HELP!!!
    By ajh2014 in forum Forms
    Replies: 5
    Last Post: 10-17-2014, 06:20 AM
  2. Cascading Combo Box help
    By kspabo in forum Access
    Replies: 11
    Last Post: 06-27-2014, 01:00 PM
  3. Replies: 1
    Last Post: 02-27-2014, 03:43 PM
  4. Cascading Combo Box Help
    By euphoricdrop in forum Forms
    Replies: 3
    Last Post: 04-12-2011, 05:35 PM
  5. cascading combo
    By rexb in forum Forms
    Replies: 9
    Last Post: 10-26-2009, 04:10 PM

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