View Single Post
  #8  
Old May 9th, 2005, 11:00 AM
Wayne Morgan
external usenet poster
 
Posts: n/a
Default

Well, you can't get the correct data to show on the form unless the correct
data is in the table. If you want the form to display data from more than
one column in the combo box, that can be done. Place a textbox next to the
combo box and set the textbox's control source to an equation that points to
the column of the combo box you want to display.

Example:
=cboMyCombo.Column(1)

The index number for the Column property is zero based, so 0 is the first
column, 1 is the second, etc. While you can display multiple columns in the
drop down list, once a selection has been made, the first visible column
will display in the combo box, you can use the above example to display
other desired columns. Once you have a unique value stored, you will get the
correct value back instead of the first one with the same calorie content as
you were getting.

To get the sum from this, use a query with the form's record source and the
lookup table with the food and calories linked together. Use DSum() to
retrieve the sum of the records for that day.

One possible setup for all of this would be a main form with the day and sum
information and a subform with the multiple food entries for that day.

--
Wayne Morgan
MS Access MVP


"FrankSpokane" wrote in message
...
I think we might be talking about 2 different things - you're talking about
getting the right info in the table and I'm talking about getting the food
and calories to show up onscreen in the form - so I can visually see them,
and I have it summing the daily calories.

I'm sure I have a much lower-level view than yours.

Thanks for all your help and examples as I have worked through each and
learned a lot about combox boxes, cound columns, and column width
adjustment.