Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Posts
    8

    Unanswered: skip record in report?

    hi,
    i want to skip first 2 records in a report.
    my situation is that the first 2 records in the report printed in the first page with format A. after first 2 records, the afterward records will be print in another format B afterward.
    so, the first 2 records can be query with "select top 2..." but, i dont know how to get the afterward records with sql statement or use any tricky VBA method to skip the first 2?

    any help?

    thanks,
    jim

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Well this is a goofy one isn't it?

    heh.


    Anywho, you could use a subform in it's own section for the first two records and use the SELECT TOP 2 method you have alread described. Then you can set the recordsource for the main report to
    SELECT yourstatement
    WHERE yourKeyField NOT IN (SELECT TOP 2 yourKeyField your query)

    That will return everything that DOESN'T match the top 2 records, which you've already returned.

    Is that what you were looking for?

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: skip record in report?

    Originally posted by zecodela
    hi,
    i want to skip first 2 records in a report.
    my situation is that the first 2 records in the report printed in the first page with format A. after first 2 records, the afterward records will be print in another format B afterward.
    so, the first 2 records can be query with "select top 2..." but, i dont know how to get the afterward records with sql statement or use any tricky VBA method to skip the first 2?

    any help?

    thanks,
    jim
    Here's all you need to do:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Me.CurrentRecord < 2 Then
    Cancel = 1
    Exit Sub
    End If

    End Sub

  4. #4
    Join Date
    Feb 2004
    Posts
    8

    Re: skip record in report?

    Excellent! thank u very very much!



    Originally posted by M Owen
    Here's all you need to do:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Me.CurrentRecord < 2 Then
    Cancel = 1
    Exit Sub
    End If

    End Sub

Posting Permissions

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