[AccessD] populating a textbox-type field in one table, calc'ed from another table

Charlotte Foust charlotte.foust at gmail.com
Wed Jul 6 11:14:28 CDT 2011


Default values aren't calculated but row sources are.  You would need to put
some code behind the form to load the value into an unbound textbox in the
appropriate event, probably the On Current event.

Charlotte Foust

On Wed, Jul 6, 2011 at 5:50 AM, William Benson (VBACreations.Com) <
vbacreations at gmail.com> wrote:

> Dear Colleagues,
>
> The below expression works when the display control for the field is a
> listbox, and the above expression its row source. But it won't work (as
> written) when the display control is a textbox and the expression is the
> Default Value -- getting syntax error.
>
> Default Value = SELECT Sum(Tbl_Field_Values.Items) FROM Tbl_Field_Values
> WHERE Tbl_Field_Values.WB = WB  and Tbl_Field_Values.WS = WS  and
> Tbl_Field_Values.FLD = FLD GROUP BY Tbl_Field_Values.WB,
> Tbl_Field_Values.WS, Tbl_Field_Values.FLD;
>
> Table: Tbl_Field_Values_Header
> Field: SumOfItems
>
>
> Can the syntax be improved to cause the sum of all items where WB, WS, and
> FLD match between Tbl_Field_Values and Tbl_Field_Values_Header, to display
> as the default value in the field I am trying to populate (SumOfItems) in
> my
> Tbl_Field_Values_Header table?
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
>
>
> Website: http://www.databaseadvisors.com
>
>
>



More information about the AccessD mailing list