Cascading ComboBoxes

L'apprentis

Redcifer
Local time
Today, 06:19
Joined
Jun 22, 2005
Messages
177
Hi

I have 4 Comboxes all Cascading from one an other and it's all working fine.
My question is about My fourth combo boxe, It as two fields that the user can see when he selects the fourth comboboxe; pretty straightforward...

I want the user to see the two fields on the form after using the combo boxe. For this I have one of the record to populate the comboboxe and the other one to populate an other text box using the dlookup function where the criteria is = to the field selected in the combo boxe, I hope you're following...

Now, some of my records for each fields are not all different from each other so when the user select a set of value the "dlookup text box" may have several option: the index is not unique if you see what I mean...

To have the unique index, I would need to add to the 4th combobox the primary key which is an autoNo that the user doesn't really need to see...

So... I am thinking of hidding the primary key column in the comboBoxe and make it the main field THEN write a code on the after Update of the Comboxe to hide the comboxe and show a text box placed over the comboxe with a dlookup function with a criteria = primary key and an other text box set on a different field with the same criteria.

I hope this is making sense, I was wondering what you were thinking of this method, it seems to involve a lot of fiddling which I don't mind but I'd rather make sure that i making it right.
 
L',

The user doesn't have to see the AutoNumber key for you to use it.

Refer to it by --> YourCombo.Column(0)

The column references START at 0.

Or move .Column(0) to a hidden textbox on the combo's AfterUpdate.

Wayne
 
Cheers wayneRyan,
I have tried to refer to the column as you advised but it doesn't seem to work. I have used the following expression to define the criteria in a Dlookup function,
"CasingID=forms.FrmLineDetail.CboCasing.column(0)"
 
L,

If the combo is on your form, your criteria would be:

DLookUp("[SomeField]", "SomeTable", "CasingID = " & Me.CboCasing.column(0))

Wayne
 

Users who are viewing this thread

Back
Top Bottom