Dynamic row source (1 Viewer)

Tupacmoche

Registered User.
Local time
Today, 10:45
Joined
Apr 28, 2008
Messages
291
I want to dynamically select two different 'Value List' based on the value of a column in a table. The values are P for person and O for organization. If the value is P then the Value List should be : ["Soft";"Joint";"IHO";"IMO";"Faculty & Friends"] but if the value is O then the Value List should be : ["Soft";"IHO";"IMO";"Faculty & Friends"]. As you can see this string dose not include the value 'Joint'. I want this string to dynamically become the row source of a combo Box. Any ideas?:confused:
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 07:45
Joined
Aug 30, 2003
Messages
36,126
You can set the row source of the second in the after update event of the first. In your case, to one of the two strings. Personally I'm not a fan of value lists as the row source for combos. I put the values in a table so I can let the users manage them when new ones come along.
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:45
Joined
Sep 21, 2011
Messages
14,322
Put them in a table and use the column value as criteria for the row source ?
 

Tupacmoche

Registered User.
Local time
Today, 10:45
Joined
Apr 28, 2008
Messages
291
Sorry that, I'm dense today. I created a table with two columns first one is Person_or_Org {p, o}, second column AssociatedString {"Soft";"Joint";"IHO";"IMO";"Faculty & Friends", "Soft";"IHO";"IMO";"Faculty & Friends" } Now, how do, I code it so when a row represent a person 'p' that string is selected vs the other string?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 07:45
Joined
Aug 30, 2003
Messages
36,126
Normally more like

p soft
p joint
...
o soft
o IHO
...

Then use the p/o field as the criteria for:

http://www.baldyweb.com/CascadingCombo.htm

You could do it with what you have, but it would be unusual, and you'd be counting on users to input the string exactly correct...which is asking too much of the average user. :p
 

Tupacmoche

Registered User.
Local time
Today, 10:45
Joined
Apr 28, 2008
Messages
291
This is what I came up with after asking for help. Please see attachments. As I said the table has two columns. The values for person_or_Org is pre-populated into the table so when you select the combo box the AssociatedString is bought in based on P or O. What is going wrong is that instead of showing a pull down with these items to choose from it's showing them as one long string. When, I had them as a value list they were listed as individual items to choose from. What do, I have to change?:(
 

Attachments

  • AssociatesGiftCodes.JPG
    AssociatesGiftCodes.JPG
    40.5 KB · Views: 103
  • AssociatesGiftCodes2.JPG
    AssociatesGiftCodes2.JPG
    20 KB · Views: 96

pbaldy

Wino Moderator
Staff member
Local time
Today, 07:45
Joined
Aug 30, 2003
Messages
36,126
I'd go with the design in post 5. If you stick with what you have, you need to use code to drop that string into the row source property. You could use a combo to pick them, have the string in a hidden column, and use that to populate the row source.
 

Users who are viewing this thread

Top Bottom