Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

continuous form - different values

Status
Not open for further replies.

zrzr

Programmer
May 22, 2003
83
FR
Hi !!!

I have a continuous form with a combobox.Data in the combobox are based on a table :

ID | Name
******|*********
1 | name 1
2 | name 2
...

What I want to do is to change the data into the combobox depending on the value of this combobox.
e.g : If the value selected in the combobox is 1, then I want to put 1, 4 and 5 into the combobox, if the value is 2, I want 1 or 2 ....

On a single form, I could use VBA code in Form_Open method, but how can I do with a continuous form ?
 
Put the code to reload the second combo in the AfterUpdate event of the first combo box.

Depending upon how complex your requirements are, you could use a many-to-many relationship to tell you which rows to load.

A quicker alternative may be to add a text field with delimited string tags in it; one tag for each choice in the first combo box. Put this delimited tag-string into the table that supports the second combo box. Then use the INSTR() function to show only the rows with a particular tag.

For your example above, the data for the second combo could be:
Code:
SecondComboValue Tag
---------------- ------
1                "1;2;"
2                "2;"
3                ";"
4                "1;"
5                "1;"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top