Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Crestview Hills, Kentucky, USA
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding Field Values on Form (Access 2003)

    I am trying to place a text box on a form. The formula in the text box adds about 15 currency fields from four different queries. None of the fields is a calculated field, all are number fields. I've tried typing the formula, I've tried using the Expression Builder and copying the result into the control. Everything results in the NAME error.

    Any suggestions?

    Thanks,
    Craig.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Adding Field Values on Form (Access 2003)

    Are the fields included in the record source of the form?

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    Crestview Hills, Kentucky, USA
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Field Values on Form (Access 2003)

    Hans:

    Thanks for the response.

    No. The record source is one on the four queries. The form contains three sub-forms from the other three queries. The totals control adds values from all four queries. I thought that if the query name and field was included, Access could include values from a query other than the record source of the form.

    Not so?

    Craig.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Adding Field Values on Form (Access 2003)

    > I thought that if the query name and field was included, Access could include values from a query other than the record source of the form

    No, it can't, at least not directly.

    If the fields are included in the record sources of the subforms, you can refer to them on the main form as

    [SubformName]![ControlName]

    where SubformName is the name of the subform as a control on the main form; this is not necessarily the same as the name of the subform in the database window. You can see the control name by opening the main form in design view and clicking once on the subform. The Name property is the control name.

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Location
    Crestview Hills, Kentucky, USA
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Field Values on Form (Access 2003)

    Hans:

    Here's the formula I used:
    =[Applicant Query]![KTAP]+[Applicant Query]![ChildSupport]+[Applicant Query]![FoodStamps]+[Applicant Query]![SSI_SSD]+[Applicant

    Query]![EarnedIncome]+[Applicant Query]![OtherIncome]+Forms![SubSpouse Form]![SpKTAP]+Forms![SubSpouse Form]!

    [SpChildSuppport]+Forms![SubSpouse Form]![SpFoodStamps]+Forms![SubSpouse Form]![SpWIC]+Forms![SubSpouse Form]!

    [SpHUD]+Forms![SubSpouse Form]![SpSS]+Forms![SubSpouse Form]![SpSSI_SSD]+Forms![SubSpouse Form]![SpOther]+Forms!

    [SubSpouse Form]![SpEarned]+Forms![SubChild Form]![ChSS_SSI_SSD]+Forms![Sub Additional Adults Form]![MonthlyIncome]

    What am I missing?

    Craig.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Adding Field Values on Form (Access 2003)

    If Applicant Query is the record source of the main form, try omitting the [Applicant Query]! from before the relevant control names.
    And omit Forms! from before the references to the subform. A subform is not part of the Forms collection

  7. #7
    Star Lounger
    Join Date
    Jan 2001
    Location
    Crestview Hills, Kentucky, USA
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Field Values on Form (Access 2003)

    Perhaps that's where I have gone astray. I'm in the habit of actually creating a subform in the Forms objects, then placing each subform on a separate tab of the main form. So, when I use the expression builder, it puts "Form!" before the name of the tabbed form named "subchild form" for example.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •