Results 1 to 4 of 4
  1. #1
    BowBeforeMeMySlave is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    2

    Add A Querie to the Report

    Greetings! I am creating a report. However there is a problem. I need to print a result from my querie to the report. This is the said querie
    "Select Transaction,Amount
    From Sheet1
    Where VoucherNo = VN
    "
    VN is an input where the grouping will be done.


    However, I do not know how to proceed.
    It seems there is no button as to how to add a field to Report(a blank one my friend) where I can designate its value as the result of my querie. How will I proceed?

    By the way other questions:
    If I have this table
    VoucherNo Transaction Amount Name

    How would I do it so at each page I have all of the reports unique to the VoucherNo and the Transactions and Amounts are grouped by VoucherNo. Thanks. ^^

  2. #2
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You would use the following query:

    Select VoucherNo, Transaction,Amount
    From Sheet1


    Create a report based on the above query. Set up a group on VoucherNo, include both the header and footer for the group and include the sum of the amount field in the footer.

    Now to show the report for only 1 voucherNo that you choose, create an unbound form with a combo box. Base the combo box's rowsource on the following query:

    SELECT DISTINCT VoucherNo
    FROM Sheet1

    Include a button on the form. In the code behind the button, you can filter the report as follows (you will have to substitute your particular names below):

    Code:
    DoCmd.OpenReport "YourReportName", acViewPreview, , "[VoucherNo]=" & Me.comboboxname

  3. #3
    BowBeforeMeMySlave is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    2
    Cool dude! Now I have another question, how can I place a new field on the report which is not existing on the database?

    I have two amounts and I want to add them and the resulting thing would be the new field. Help?

  4. #4
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I'm not sure I understand. You can add the values in two controls on the report by using an expression in a third control, but the 2 controls that supply the values that need to be added would have to be in the same record. According to your earlier post you only have the amount field.

    If the 2 amounts are for the same voucher, you would use the sum() function in a control that you would place within the group footer for the voucherNo.

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

Similar Threads

  1. Number querie
    By Rigsby in forum Queries
    Replies: 3
    Last Post: 02-08-2011, 06:41 AM
  2. Replies: 4
    Last Post: 12-13-2010, 05:33 PM
  3. Querie criteria with list
    By apsf68 in forum Access
    Replies: 1
    Last Post: 12-04-2010, 12:13 PM
  4. update querie
    By frcastro in forum Queries
    Replies: 1
    Last Post: 06-23-2010, 04:20 AM
  5. querie problem
    By TIMT in forum Queries
    Replies: 2
    Last Post: 05-31-2009, 10:12 AM

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