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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update combo box source in continuous form

Status
Not open for further replies.

jflachman

Technical User
May 30, 2001
133
0
0
US
OK, here is my problem:
I have 2 tables:

Tests
-TestID (Autonumber)
-TestDesc (Text)

TestInput
- TestInputID
- TestID
- InputDesc

Now, in my CONTINUOUS form I have 2 combo boxes:
The first one uses the tables TESTS as the rowsource.

In the second one I want to display only the TestInput values that are valid for that TestID.

I have tried the following:
- In the AfterUpdate event for the TESTS combo, I reset the rowsource for the TestInput combo.

What happens is that this updates the RowSource for that field in every record in the form. Since different records have different TESTS combo values, in NON-CURRENT records, the TestInput combo goes blank when the TestInput ID is not valid for the CURRENT record TestID.

I tried doing the same update in the OnEnter event for the TestInput combo. That way when you click on a combo that "appears" blank but really isn't the valid data appears.

Is there any way to set the combo box rowsource or other property in such a way that other records are not affected?

Any help is appreciated


Jonathan
________________________________________
It is not fair to ask of others what you are unwilling to do yourself.
-Eleanor Roosevelt
 
Your TESTS combo shouldn't be bound.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
this doesn't actually solve the problem. This only makes the Test for every record the same.

The problem is with the TestInput combo box. The source for the TestInput combo box should be either:
1) Filtered or limited to the appropriate selection in the current record only - that way the saved value in other records is valid, even if it does not fall in the rowsource for the CURRENT record.
2) Have a different filter or recordsource for each record.


Valid inputs for TEST1 are INPUT1 and INPUT2
Valid inputs for TEST2 are INPUT3 and INPUT4

When I select TEST1 in the TESTS combo, I want INPUT1 and INPUT2 to be the choices in the TestInput Combo. However, in the previous record, where TEST2 was the choice in the TESTS combo, I still want to see that the user selected INPUT3.

If I update the rowsource in the current record to include only INPUT1 and INPUT2, then any previous records where INPUT3 or INPUT4 were selected go blank because they are not in the rowsource.


Does that help you understand my challenge?



Jonathan
________________________________________
It is not fair to ask of others what you are unwilling to do yourself.
-Eleanor Roosevelt
 
Sorry, didn't realize you talked about a continuous form.
An unbound control in the detail section of a continuous form has the same value for all the records...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top