Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Vail, Colorado, USA
    Posts
    194
    Thanks
    36
    Thanked 0 Times in 0 Posts

    Create Report footer with VB (2000)

    Is there a way to create a report footer using VB or is the only way of doing it to use the CreateGroupLevel method. I just want a total of a number of fields in my report and grouping is unnecessary. Therefore to use the CreateGroupLevel method I would have to put in an uncessary field that was the same for all records.
    In desgin view one just right clicks on the very top and one of the options is report footer, but I cannot find the code for that.

    Thanks

    Peter

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

    Re: Create Report footer with VB (2000)

    Use RunCommand acCmdReportHdrFtr. The report must be open in design view, otherwise error 2046 occurs.

  3. #3
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Vail, Colorado, USA
    Posts
    194
    Thanks
    36
    Thanked 0 Times in 0 Posts

    Re: Create Report footer with VB (2000)

    Hans

    Thanks again ,that put the report footer and header in. Now I need to put the sum controls in to total my columns. Howveer the following code

    Set ctl = CreateReportControl(rptname, acTextBox, acFooter, , "=sum(Week" & n & ")", xy, 0, 980, 200)

    Tells me I have referred to the wrong section number in the report. Access help says the ac footer is 2 and does not give a number for report footer, although help suggest that footer and report footer are the same. Sorry to bother you but can you help

    thanks Peter

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

    Re: Create Report footer with VB (2000)

    Sorry for the late reply. The symbolic constant acFooter is meant for the report footer, but the report footer MUST exist before you can put anything in it. If the footer does exist, your code will create a control, and even adjust the height of the report footer if necessary. If the report footer hasn't been created yet when you try to create a control, you'll get the error message you mention.

  5. #5
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Vail, Colorado, USA
    Posts
    194
    Thanks
    36
    Thanked 0 Times in 0 Posts

    Re: Create Report footer with VB (2000)

    Thanks Hans

    Its now working, did not watch the order of my code.

    Regards


    peter

Posting Permissions

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