Results 1 to 8 of 8
  1. #1
    quandore is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    15

    implement expressions

    Hello everybody,

    i'm a beginner i hope you'll have patience! i just made a form in access that allows me to filter some product group's of a query. this query contains:

    product groups; material numbers (single products); type of vehicle; population (how many vehicles have been sold in a particular market).
    with the form i just created i can filter for the product groups. a product group contains several material numbers. the vehicle types can have only 1 population.

    Now i want to make access do simple math within the outcome of the filtered query.



    a) to sum of the filtered population (i.e. the total of population within that particular product group)
    b) calculate the ratio between the filtered population and the total of population.

    i have no idea where to start!

    sorry if it's confusing... i'll try to be more precise if you want to ask something.

    and thanks!

  2. #2
    dblife's Avatar
    dblife is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    104
    You could use this query to make a form in continuours view and have boxes in the form footer to display what you want to calculate.
    If the 'filtered population' figures are displayed in a control called 'txtFilteredPopulation', drag a new text box onto the footer and write inside it,
    '=sum([txtFilteredPopulation])
    That will show you the sum of what that column is.
    You can do various arithmetic functions using this method.

  3. #3
    quandore is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    15
    Quote Originally Posted by dblife View Post
    You could use this query to make a form in continuours view and have boxes in the form footer to display what you want to calculate.
    If the 'filtered population' figures are displayed in a control called 'txtFilteredPopulation', drag a new text box onto the footer and write inside it,
    '=sum([txtFilteredPopulation])
    That will show you the sum of what that column is.
    You can do various arithmetic functions using this method.
    Hi, and thank you for your answer.
    could you please explain into more details the procedure i should follow?

    sorry i'm a beginner with access...

  4. #4
    dblife's Avatar
    dblife is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    104
    consider the two images shown.
    the table shows products cost and qty.
    i have made a simple form in continuous view and in the footer of the form, pulled a text box onto the footer and written the code shown [image 1]
    when i switch to normal view on the form, the calculation is shown [image 2]

  5. #5
    quandore is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    15
    ok, i managed to have the subtotals displayed in the form. i added a text box in the subform and put the formula =sum([fieldname]) and then i added another text box into the form, and made a ref to the control in the subform. so good so far.
    now i need to have the SUPER-TOTAL, not just the "filtered total". so i actually need to display the sum of the entire population so that i can calculate the ratio between the filtered pop. and the total pop.
    i need your help here, coz i've been struggling all day to manage this but i miserably fail.
    the problem is, how can i obtain the total population in the form? this way i only obtain the total of the population filtered by product groups. i need the total of the population of all the discount groups combined.
    any hint?

  6. #6
    quandore is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    15
    dblife thank you for your help. i just read your post. i had to manage that part myself coz i'm out of time. if you read my last post maybe you will find the time to help me with this second step?
    thank you,
    Francesco

  7. #7
    dblife's Avatar
    dblife is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    104
    for this, you might find the 'DSum()' function useful.
    dsum refers to domain - a domain is a data source whether its a table or a query.
    the syntax is
    DSum("pCost", "tProducts")
    or it could just as easily be applied to a query which calculates the total per item using cost and qty.

  8. #8
    quandore is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    15
    it worked quite smoothly. thank you!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to implement security in access
    By jerill in forum Access
    Replies: 10
    Last Post: 11-03-2011, 11:45 AM
  2. Implement Forms Only on Start Up
    By fat ralphy in forum Forms
    Replies: 5
    Last Post: 10-21-2011, 02:08 PM
  3. How would I implement this?
    By redfox1160 in forum Access
    Replies: 4
    Last Post: 03-09-2011, 03:07 PM
  4. Password Idea (how to implement?)
    By dinorbaccess in forum Access
    Replies: 2
    Last Post: 02-17-2011, 07:45 AM
  5. Finalise database and implement??
    By turbo910 in forum Access
    Replies: 4
    Last Post: 12-12-2009, 04:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums