Re: Access 2003 forms lookup problem
- From: "Wayne Morgan" <comprev_gothroughthenewsgroup@xxxxxxxxxxx>
- Date: Mon, 9 May 2005 05:00:36 -0500
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" <FrankSpokane@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:40DD7935-1823-4A6A-B5B2-3147FBB4780D@xxxxxxxxxxxxxxxx
>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.
.
- References:
- Access 2003 forms lookup problem
- From: FrankSpokane
- Re: Access 2003 forms lookup problem
- From: Wayne Morgan
- Re: Access 2003 forms lookup problem
- From: FrankSpokane
- Re: Access 2003 forms lookup problem
- From: Wayne Morgan
- Re: Access 2003 forms lookup problem
- From: FrankSpokane
- Re: Access 2003 forms lookup problem
- From: Wayne Morgan
- Re: Access 2003 forms lookup problem
- From: FrankSpokane
- Access 2003 forms lookup problem
- Prev by Date: Re: Form + 2 subforms
- Next by Date: Re: Tab controls in 2003
- Previous by thread: Re: Access 2003 forms lookup problem
- Next by thread: how to convert this SQL statement to use in vba?
- Index(es):
Relevant Pages
|