1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Combo Box Help

Discussion in 'Business Applications' started by finneyz, Feb 1, 2013.

Thread Status:
Not open for further replies.
Advertisement
  1. finneyz

    finneyz Thread Starter

    Joined:
    Jan 17, 2013
    Messages:
    39
    Hello Again.
    I am having an issue with my combo box. The code I am using is not populating my other boxes.
    attached is my database. and form.
    This is the code I am using for the combo box.
    It is not pulling in the data from the query.



    Private Sub Combo69_Change()
    Me.txtMATL_.Value = Me.Combo69.Column(1)
    Me.txtFINISH.Value = Me.Combo69.Column(2)


    End Sub

    I have several other fields that need to be filled in.
    I was hoping that this would work but it is not.
    Any other ideas by chance?
     

    Attached Files:

  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Sorry, I can't open your database the form has Access 2010 features that Access 2007 can't handle.
    Assuming that your Combo has values showing for Columns 1 & 2 then they should be transferred to txtMATL_ & Me.txtFINISH.
    Remember that the the first column of a Combo is designated column(0).
    However you do not need the .value in the code
    Me.txtMATL_ = Me.Combo69.Column(1)
    Me.txtFINISH = Me.Combo69.Column(2)
    should do it.
     
  3. finneyz

    finneyz Thread Starter

    Joined:
    Jan 17, 2013
    Messages:
    39
    Ive saved it as 2003. That might work for you.
    In the properties it says access 2007 for saved features.
    Not sure.. why it isnt working for you
     

    Attached Files:

  4. finneyz

    finneyz Thread Starter

    Joined:
    Jan 17, 2013
    Messages:
    39
    I found out what it is called. Cascading combo boxes.
    Just needing some help in getting mine along
     
  5. finneyz

    finneyz Thread Starter

    Joined:
    Jan 17, 2013
    Messages:
    39
    tried still isnt working.
    It sees the values fine from the other table. But does no populate it into the text field
    I found out what its called. Cascading combo boxes
     
  6. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Cascading combo boxes are special cases and I have posted many examples on the Forum, you cannot just assign values to the combo box, you have to Filter the combo box's SQL query with the prior combo's value.
     
  7. finneyz

    finneyz Thread Starter

    Joined:
    Jan 17, 2013
    Messages:
    39
    Ive tried this as well. and still giving an issue. Is the line correct?Private Sub Combo71_AfterUpdate()
    Me.txtUNIT_WT_LBS.Value = DLookup("unit_weight", "mml_lom_1", "parts_id = '" & Me.Combo71 & "'")

    End Sub
     
  8. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    I always use the SQL Filter method as it can be tested in a query first.
    Do you know how to set a query Criteria Filter?
     
  9. finneyz

    finneyz Thread Starter

    Joined:
    Jan 17, 2013
    Messages:
    39
    no not 100%.
    this is what I have for my combo box
    SELECT [mml_lom_1].[PARTS_ID], [mml_lom_1].[PARTS_DESCRIPTION], [mml_lom_1].[UNIT_WEIGHT] FROM mml_lom_1 ORDER BY [PARTS_ID];

    I know you had trouble viewing it before.
     
  10. finneyz

    finneyz Thread Starter

    Joined:
    Jan 17, 2013
    Messages:
    39
    again, thank you again for your help
     
  11. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Which combo is this the first or second in the cascade?
    ie. which value do you want to pass on to the second combo?
     
  12. finneyz

    finneyz Thread Starter

    Joined:
    Jan 17, 2013
    Messages:
    39
    also, its text not a numeric value
     
  13. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    See my question prior to your last answer.
     
  14. finneyz

    finneyz Thread Starter

    Joined:
    Jan 17, 2013
    Messages:
    39
    the first column is what is our description. The second column would be say the weight or the materials (copper, silver)
     
  15. finneyz

    finneyz Thread Starter

    Joined:
    Jan 17, 2013
    Messages:
    39
    there is only 1 combo box. It will populate. about 5 different textboxes
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1087786

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice