Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3215268
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:09:28+00:00 2026-05-17T15:09:28+00:00

I have a purchase form that has a continuous subform which shows line items

  • 0

I have a purchase form that has a continuous subform which shows line items for that purchase. Each line item needs to include a text box that shows the sum for a number of related records in a table for that line item.

(Each line item is allocated for a specific purpose(s). For instance, a line item says that 100 widgets are ordered; the allocation table says that 20 widgets are for this purpose and 40 are for this purpose. The text box needs to say that 60 / 100 are allocated.)

I have written this in VBA for the OnCurrent event of the form, but this only occurs when the first “copy” of the continuous form receives focus. Then all the other “copies” of the form show the same values in the text box.
I then realized that I could perhaps do this as part of the query for the form. Whenever I add … Sum(Quantity) AS TotalAllocations to the SQL query, I get the following error:

“You tried to execute a query that
does not include the specified
expression ‘VendorPartNumber’ as part
of an aggregate function.”

(VendorPartNumber is a field for the records that show up on the continuous form.)

Can someone explain how to do this successfully in a query designer / SQL view or with VBA?

Complete aside:
Ideally, it would be nice to have this as a continuous subform on a continuous subform. However, Access does not allow continous subforms on continuous subforms.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:09:29+00:00Added an answer on May 17, 2026 at 3:09 pm

    If you’re going to SUM in SQL, you need to include a GROUP BY clause for the non-aggregated columns, such as:

    SELECT VendorPartNumber, Sum(Quantity) as TotalAllocations
        FROM YourTable
        GROUP BY VendorPartNumber
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form request_form.php, that is manage Purchase Request Form for request item.
In a customised form I would have a create Purchase Menubutton which opens a
I have an order entry form that has a ListBox with a list of
I have an application that has one purchase_order for each purchase_request. My models are
I have a model named UserPrice which has a form where you can create
I'm running an online shop and I'm trying to have the purchase (which is
I have an application with In-App Purchase, that when the user buy something, download
i have a few voice files which i am selling with inapp purchase(download with
I have a model named UserPrice which has the attribute :purchase_date (a date_select) in
I have a form that im trying to get emailed on submit using PHPmailer.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.