0

I'm relatively new to access and have a problem. I have multiple rows of information on a form, and each of these rows has a few text boxes and one combo box. The combo box needs to have different information in it based on another field in the row. The combo box is Units, and if the Measurement Type is "Length" for example, then the combo box would populate itself with "inches", "cm", "mm". There are about 8 different Measurement Types and each has a different list of units. My question is whether or not this is possible given the current form design. Attached are two pictures. The first one is the form in Design view, the second is in form view.

For Example,
In the combo box marked A, I want the drop down to contain "cm", "inches", "mm".
In the combo box marked B, I want the drop down to contain"lbs", "kg", "g".
In the combo box marked C, I want the drop down to contain "inch-lbf", "ft-lbf", "oz-in", "oz-ft".
And each one as we go down the line from there could have a different set of values.

Is it possible to have all of these at the same time?

Edited by leverin4: n/a

Attachments Design_View.JPG 132.9 KB Form_View.JPG 91.08 KB
3
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by ChrisPadgham
0

What do you mean by "drop down"? once, what ive done was i had to combos so, for example lets suppose the second one was dependong on the first on, so lets suppose:

First combo is 1 - Second Combo is 1, 2, 3
Second combo is 2 - Second Combo is 4, 5, 6
Third combo is 3 - Second Combo is 7, 8 , 9

It was easy to do it, but apparently you have a list of records, and i think my way does not work for you. Anyway, what i did was, I created one combo, and in it was 1, 2, 3 and i named it First_Combo and then I created another combo, and in it was 1, 2, 3 and I named it Second_Combo_1, then I created another combo, and in it was 4, 5, 6 and I named it Second_Combo_2 and finally I created another combo, and in it was 7, 8, 9 and I named it Second_Combo_3, Then i used visual basics to put it working, the code was something like:

If First_Combo = "1" then
Second_Combo_1.Visible = True
Second_Combo_2.Visible = False
Second_Combo_3.Visible = False
ElseIf First_Combo = "2" then
Second_Combo_1.Visible = False
Second_Combo_2.Visible = True
Second_Combo_3.Visible = False
Else
Second_Combo_1.Visible = False
Second_Combo_2.Visible = False
Second_Combo_3.Visible = True

But I dont think that will work for you, it might do tho.

0

What do you mean by "drop down"? once, what ive done was i had to combos so, for example lets suppose the second one was dependong on the first on, so lets suppose:

First combo is 1 - Second Combo is 1, 2, 3
Second combo is 2 - Second Combo is 4, 5, 6
Third combo is 3 - Second Combo is 7, 8 , 9

It was easy to do it, but apparently you have a list of records, and i think my way does not work for you. Anyway, what i did was, I created one combo, and in it was 1, 2, 3 and i named it First_Combo and then I created another combo, and in it was 1, 2, 3 and I named it Second_Combo_1, then I created another combo, and in it was 4, 5, 6 and I named it Second_Combo_2 and finally I created another combo, and in it was 7, 8, 9 and I named it Second_Combo_3, Then i used visual basics to put it working, the code was something like:

If First_Combo = "1" then
Second_Combo_1.Visible = True
Second_Combo_2.Visible = False
Second_Combo_3.Visible = False
ElseIf First_Combo = "2" then
Second_Combo_1.Visible = False
Second_Combo_2.Visible = True
Second_Combo_3.Visible = False
Else
Second_Combo_1.Visible = False
Second_Combo_2.Visible = False
Second_Combo_3.Visible = True

But I dont think that will work for you, it might do tho.

I think you're right about that not working for me. The problem is that if I change the values of the combo box in one place, they all change because technically I think they're all the same combo box. I'm not sure how to get it to work on an individual row basis. I really hope someone here can.

0

You could make it by pages instead of using different rows, if you know what I mean? I will check later, what you could do, if I find something I Will post it here.

0

You could make it by pages instead of using different rows, if you know what I mean? I will check later, what you could do, if I find something I Will post it here.

I'm not sure what you mean. Were you able to find any examples?

0

I am currently taking IT GCSE at school and I got a form, inside that form I have 3 tabs, one hiden and only appears when in the tab two the user presses "Buy this item", and I got other two normal tabs. Basically, all of them write to a different table, and in my form a can actually go to the next and back record i can then switch tab and do the same (next/back). I you had something like this i suppose it would work. Check the picture of my form. Those buttons actually work, and everything in that form works too.

Attachments name1.jpg 43.43 KB
0

another approach Retrieve your combo box values from a table with 2 columns as follows

cm,A
inches,A
mm,A
lbs,B
kg,B
g,B

etc

the source query for combo 2 should contain both columns with a condition on the second column of the value of the first combo, eg Forms![myform].combo1

in the click event of the first combo requery the second combo
private sub combo1_click
me.combo2.requery
end sub

Edited by ChrisPadgham: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.