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

2 unbound combo's and subform best solution?

Status
Not open for further replies.

pinstripe

Programmer
Dec 27, 2004
52
Hi all,
have a form with 2 unbound combo's and a subform.

First combo has RowSourceType= ValueList and RowSource = "Plate";"Driver";"Company";
Second combo and i fill RowSource with VBA:

If Me.cboCombo1 = "Plate" Then
Sql = "SELECT [Vozilo].[IdVozilo], [Vozilo].[Plate] FROM Vozilo;"
Me.cboCombo2.RowSource = Sql
Me.cboCombo2.Requery

And same if it is "Driver" or "Company".
Then i have subform linked with child fields "IdVozilo"(unique number)
and master fields "cboCombo2"

But the point is that beacuse of that i need to have 3 subforms - 1 for each("Plate";"Driver";"Company";).
I wanna to have just one subform no matter which one is picked up and that tha data would still be correct.

Thank you for your help.
Best,
 
How are ya pinstripe . . .

Having more than one set of data on a form [blue]complicates your design in an undesirable manner[/blue]. Consider future changes to one subform that ripple their way thru to the other subforms, and, round and round you go . . . [purple]It can be done, but I wouldn't recommend it.[/purple]

Its too easy to [blue]make three subforms[/blue] (one on top the other) [blue]and show/hide the approriate subform accordingly[/blue] . . .

Your thoughts? . . .

Calvin.gif
See Ya! . . . . . .
 
Hi TheAceMan1,
thank you for your response.

The thing is: right now i have 3 subforms one on top of the other and i am showing them accordingly!
The problem comes out when i wanna to have another subform(2) on this sub form and show the record based on the selected record in subform(1)
I took your advice FAQ702-5860 and it works fine if you have one subform(1), but in this case i would have 3 subform(1).
It goes wrong when puting a criteria for a subform(2) -> Do i need to put on 3 subforms(2) - one for each subform(1)
That is whay i am asking if sould there be just one subform(1) instead of 3 !?

Any pointer or thought would be greatly appreciated.
Best,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top