Combo Box Help

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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?
 

Attachments

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.
 

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
 

Attachments

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
 

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
 

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.
 

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
 

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?
 

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.
 

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?
 

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)
 

finneyz

Thread Starter
Joined
Jan 17, 2013
Messages
39
there is only 1 combo box. It will populate. about 5 different textboxes
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Members online

Top