Wikipedia:Reference desk/Archives/Computing/2013 June 13

= June 13 =

international costums for cars
Can I please have a E-Mail address for car costums in Cotomou. Thanks Mark — Preceding unsigned comment added by 105.228.233.62 (talk) 13:56, 13 June 2013 (UTC)


 * Cotonou, Benin? The reference desk is probably not the best place to find such resources, but maybe if you clarify what you need we can point you in the right direction.  Nimur (talk) 14:09, 13 June 2013 (UTC)

MS Access 2007: Populating Main Form Control with Subform Value
I'm updating a database that we use to prepare financial statements. The database has a form with the fields needed to calculate the final value: call this form Main. The user enters most of the values in Main, while others are calculated values. One of the calculated values is the sum of revenues from different part of the business. There is a subform (call it Revenues) where the user can enter the revenue values, and on this subform there is a calculated field that calculates their sum (SumOfRevenues).

What I'm trying to do (and failing) is to carry SumOfRevenues back to Main and insert it into a text box control (call this control TotalRevenue). I need to do this because the sum of the revenues is one of the values needed to calculate the final value on the Main form. I know how to reference a field on a different form, but I can't figure out how to reference a calculated value in a text box on a different form.

I could store SumOfRevenues as a field and pass it that way, but this a not good practice (and this database has enough issues already with saving calculated values and other programming no-nos). I tried creating a user-defined function that reads the SumOfRevenues value, and then setting the function result as the control source for TotalRevenue: this runs, but it just returns zero. The function was:

I also tried SumOfRevenues.Value (also zero) and SumOfRevenues.Text (error, since the text box doesn't have the focus when the function is called).

So: how can I populate the TotalRevenue text box on Main with the value from the SumOfRevenues calculated text box on Revenues? Any thoughts or advice is appreciated.OldTimeNESter (talk) 14:37, 13 June 2013 (UTC)