Combo Boxes Again

  • Thread starter Thread starter TeeSee
  • Start date Start date
T

TeeSee

Access2003
I have one table.
Two forms, each with a combo box in the detail section and within each
form a subForm (wanted datasheet view) showng the remaining data as it
relates to the combo box.
In order to have only one form open in my application I placed each of
these forms on a tabbed control. All "appears" to be functioning
properly except the data gets loused up apparently due to me flipping
between combos on the two tabs.
Any thoughts as to how to solve the data mess or is ther a better way
to manipulate 2 combos giving slightly different info from the same
table and on one form.

Thanks
 
Access2003
I have one table.
Two forms, each with a combo box in the detail section and within each
form a subForm (wanted datasheet view) showng the remaining data as it
relates to the combo box.
In order to have only one form open in my application I placed each of
these forms on a tabbed control. All "appears" to be functioning
properly except the data gets loused up apparently due to me flipping
between combos on the two tabs.
Any thoughts as to how to solve the data mess or is ther a better way
to manipulate 2 combos giving slightly different info from the same
table and on one form.

Thanks

You can make a Combo Box the Master Link Field of a subform - it's not one of
the options the wizard gives you but it works. Say you have a combo named
cboMyCombo on the main form (it doesn't matter if it's on a tab page or not).
You can set the Master Link Field property of a Subform to

cboMyCombo

and the datasheet (if that's your chosen style) related to the selected value
will be shown in the subform.

Since you don't say, and we can't telepathically ascertain, how these subforms
differ I don't know if this will solve your problem, but it might be worth
trying.

John W. Vinson [MVP]
 
You can make a Combo Box the Master Link Field of a subform - it's not oneof
the options the wizard gives you but it works. Say you have a combo named
cboMyCombo on the main form (it doesn't matter if it's on a tab page or not).
You can set the Master Link Field property of a Subform to

cboMyCombo

and the datasheet (if that's your chosen style) related to the selected value
will be shown in the subform.

Since you don't say, and we can't telepathically ascertain, how these subforms
differ I don't know if this will solve your problem, but it might be worth
trying.

             John W. Vinson [MVP]

Thanks John .... Tried that but to no avail.
This table quite simply has four fields. Customer, ProductGroup,
Discount and EffectiveDate.
One form has Customer as the combo box while the other three fields
display. The other has ProductGroup as the combo and the other three
fields display. I wanted to use this information when adding a new
item to my CustomerItems table and so be able to apply the same
discount as other items in the same group already in the database.
Each Individual form works as desired it just fouls up when I try to
make it one form.
Any further thoughts would be appreciated.
 
Thanks John .... Tried that but to no avail.
This table quite simply has four fields. Customer, ProductGroup,
Discount and EffectiveDate.
One form has Customer as the combo box while the other three fields
display. The other has ProductGroup as the combo and the other three
fields display. I wanted to use this information when adding a new
item to my CustomerItems table and so be able to apply the same
discount as other items in the same group already in the database.
Each Individual form works as desired it just fouls up when I try to
make it one form.
Any further thoughts would be appreciated.

Please post the SQL of the two forms' Recordsources and the RowSources of the
combos.

You may need to use VBA code in the AfterUpdate event of the combo to "push"
the non-bound value (discount, say) from the combo into another control - but
since I don't know just what's on your form it's hard to be sure.

John W. Vinson [MVP]
 
Please post the SQL of the two forms' Recordsources and the RowSources of the
combos.

You may need to use VBA code in the AfterUpdate event of the combo to "push"
the non-bound value (discount, say) from the combo into another control - but
since I don't know just what's on your form it's hard to be sure.

             John W. Vinson [MVP]
 
Please post the SQL of the two forms' Recordsources and the RowSources of the
combos.

You may need to use VBA code in the AfterUpdate event of the combo to "push"
the non-bound value (discount, say) from the combo into another control - but
since I don't know just what's on your form it's hard to be sure.

             John W. Vinson [MVP]

It seems to me that
1) you want the first combo box to be bound to the Customer field in
the table.
2) you want all of the actual fields on both tabs to be bound to the
appropriate field of that same record in the table.
3) The second tab should NOT be a separate query but rather simply
fields from the query tha the form is bound to,
4) the query for the products should query the table and include all
of the related fields and probably show all of them.
5) Have the afterupdate event of the products combobox force the
related values from the comboboxes separate query into the fields on
the tab.

Ron
 
Please post the SQL of the two forms' Recordsources and the RowSources of the
combos.

You may need to use VBA code in the AfterUpdate event of the combo to "push"
the non-bound value (discount, say) from the combo into another control - but
since I don't know just what's on your form it's hard to be sure.

             John W. Vinson [MVP]
------------------------------------------------------------------------------
frmDiscountByCustomer. RecordSource = tblCurrentSellDiscount.
cboCustID RowSource = SELECT tblCurrentSellDiscounts.CustomerIDNumber

FROM tblCurrentSellDiscounts

GROUP BY tblCurrentSellDiscounts.CustomerIDNumber

ORDER BY tblCurrentSellDiscounts.CustomerIDNumber;
------------------------------------------------------------------------------
frmDiscountByGroup. RecordSource = tblCurrentSellDiscount. cboProdGrp
RowSource = SELECT tblCurrentSellDiscounts.ProductLine

FROM tblCurrentSellDiscounts

GROUP BY tblCurrentSellDiscounts.ProductLine

ORDER BY tblCurrentSellDiscounts.ProductLine;
 
---------------------------------------------------------------------------­---
frmDiscountByCustomer. RecordSource = tblCurrentSellDiscount.
cboCustID RowSource = SELECT tblCurrentSellDiscounts.CustomerIDNumber

FROM tblCurrentSellDiscounts

GROUP BY tblCurrentSellDiscounts.CustomerIDNumber

ORDER BY tblCurrentSellDiscounts.CustomerIDNumber;
---------------------------------------------------------------------------­---
frmDiscountByGroup. RecordSource = tblCurrentSellDiscount. cboProdGrp
RowSource = SELECT tblCurrentSellDiscounts.ProductLine

FROM tblCurrentSellDiscounts

GROUP BY tblCurrentSellDiscounts.ProductLine

ORDER BY tblCurrentSellDiscounts.ProductLine;
---------------------------------------------------------------------------­-----
Both forms now reside on a tabbed for named frmtbDiscountDisplay.
Hope this makes sense John. Thanks again for your persistence. Best
regards- Hide quoted text -

- Show quoted text -

John and Ron .... Thanks for your input to this issue but I have now
reached my level of incompetence and am lost and confused. Don't waste
any more time on this. Thanks again.
 
------------------------------------------------------------------------------
frmDiscountByCustomer. RecordSource = tblCurrentSellDiscount.
cboCustID RowSource = SELECT tblCurrentSellDiscounts.CustomerIDNumber

FROM tblCurrentSellDiscounts

GROUP BY tblCurrentSellDiscounts.CustomerIDNumber

ORDER BY tblCurrentSellDiscounts.CustomerIDNumber;
------------------------------------------------------------------------------
frmDiscountByGroup. RecordSource = tblCurrentSellDiscount. cboProdGrp
RowSource = SELECT tblCurrentSellDiscounts.ProductLine

FROM tblCurrentSellDiscounts

GROUP BY tblCurrentSellDiscounts.ProductLine

ORDER BY tblCurrentSellDiscounts.ProductLine;

Neither of these queries will be updateable. Turn off the Group By - you're
not using it!!!

John W. Vinson [MVP]
 
Back
Top