Access report paging on group

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kkshansid
    New Member
    • Oct 2008
    • 232

    Access report paging on group

    kindly guide me do create paging on group
    after start of every group new paging starts page sets to 1again and pages set to group total page
    Code:
    Function paging(vsch, vclass)
    Set rs = CurrentDb.OpenRecordset("SELECT * FROM AT WHERE f1='" & vsch & "' AND f2='" & vclass & "'")
    RSCOUNT = rs.RecordCount
    PGS = 1
    PGT = Ceiling(RSCOUNT / 24)
    paging = "PAGE" & PGS & "OUT OF" & PGT
    
    rs.Close
    Set rs = Nothing
    End Function
    this funcion on calling gives page 1 out of 1 at every page
    Last edited by kkshansid; Sep 28 '13, 09:38 AM. Reason: typo
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    kkshansid, your question is not at all clear. Nor is the reason for having a function like this you show.

    You could just make a global integer variable Page_int and reset it to 0 in the format event of each group and increment it in the Page Header format event.

    Obviously this function will always show Page 1 of something because you are setting PGS to 1 immediately before printing it.

    Is line 3 correct? You are selecting from AT but from ATDPSA in the line above.

    Jim

    Comment

    • kkshansid
      New Member
      • Oct 2008
      • 232

      #3
      that was typing mistake
      thank u so much for your guidance i am very close to what i need but there is still some problem
      Code:
      Option Compare Database
      Dim pgint As Integer
      Private Sub GroupHeader3_Format(Cancel As Integer, FormatCount As Integer)
      pgint = 0
      End Sub
      Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
      pgint = pgint + 1
      End Sub
      Function VPGINT()
      VPGINT = Str(pgint)
      End Function
      Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
      pgint = 0
      End Sub
      it always gives value 1 to both page 1 and 2 and after 3 and on wards it increment value 2 to page 3,3 to page 4 and so on
      kindly guide me

      Comment

      Working...