Results 1 to 12 of 12
  1. #1
    Join Date
    Nov 2006
    Posts
    8

    Unanswered: Split one report into two

    Hi there,
    I have a report that holds the information about all the customers in company A and B, then, I need to split this report into two so that one report would contain the info only about company A and the other would contain the info about company B.
    I am using MS Access and VB script (in the form object of MS Access)
    Please help me with this. I am new to Access and VB.

    I would really appreciate..Thank You

    -Rakhee

  2. #2
    Join Date
    Nov 2006
    Posts
    8

    split A report into two using VB script in Forms

    Hi there,
    I have a report that holds the information about all the customers in company A and B, then, I need to split this report into two so that one report would contain the info only about company A and the other would contain the info about company B while trying to print it in PDF format.
    I am using MS Access and VB script (in the form object of MS Access)
    Please help me with this. I am new to Access and VB.

    I would really appreciate..Thank You

    -Rakhee
    Last edited by rakheevissa; 11-21-06 at 22:26.

  3. #3
    Join Date
    Nov 2006
    Location
    North of San Francisco
    Posts
    19
    What does the data look like?
    Page 1 company A
    Page 2 Company B
    Or Company A, B on one page?

  4. #4
    Join Date
    Nov 2006
    Posts
    8

    How to split the pages into different reports

    Hi Guyz,
    Thank You so much for the suggestions! I really appreciate it. Like you suggested, I changed the option "grp keep together" set to per page; earlier it was per column. But still my challenge is to print the information about customers from company A in a separate report than that of Company B. As of now, all the reports for different companies are being printed in the same report per page.
    Another doubt I have is what if I have 100 patients per page..wouldn't it skip printing some of the patients while printing..Please help me . Thank you so much once again..!!

    -Rakheevissa

  5. #5
    Join Date
    Nov 2006
    Posts
    8

    Splitting one report into different reports

    Hi there,
    It looks like company A on page 1 and company B on page 2 and so on..but all in one report.
    So, I have to figure out a way to print the info about company A into one report and company B into another report. Please help me out.. . Moreover, the format of the report has to be in PDF format.
    My approach is this way:
    First split the report using VB script in MS Access and then, try printing in PDF.
    So, for that, I am planning to have a "Print different reports" button on the form (In MS Access, theVB script can be used only through forms) which will control the splitting action. Once this step is done, I can think about PDF. Please let me know your suggestions.

    Thank you..
    -Rakheevissa

  6. #6
    Join Date
    Nov 2006
    Location
    North of San Francisco
    Posts
    19
    Send the report to a file then split then send to PDF ?
    I am guessing you have no control in how the report is created.
    If you can send it to a file,...then it will be easy.

  7. #7
    Join Date
    Nov 2006
    Posts
    8
    Thank you so much for your suggestion.. I never expected such a quick reply.

    Sorry..but I am novice programmer..in VB. Could you please give me little more details about the following:
    1) The report should be sent into which kind of file(.txt,etc.)
    2) How do I do the splitting

    Thank you sooo much!

    -Rakheevissa

  8. #8
    Join Date
    Nov 2006
    Location
    North of San Francisco
    Posts
    19
    In the printer settings, you can direct the output to a file...in most cases.
    If this is possible, the spliting is easy.
    Can you do this?
    After view the file using Notepad....is it nice and neat ?
    If Yes, we split the file.

  9. #9
    Join Date
    Nov 2006
    Posts
    8
    Hi there,
    I tried to print the report in MS Access to the .txt file. Formatting is perfect..except that since it is .txt..it cannot show the images and page breaks,etc.
    But otherwise, I think it is in perfect format.
    Now, could you please solve the mystery of splitting this file for me .. I really appreciate this because, after seeing your posts.. I actually started working on this problem. Thank you so much!

    -Rakheevissa

  10. #10
    Join Date
    Nov 2006
    Location
    North of San Francisco
    Posts
    19
    Okay, the short answer.
    VB6 or Qbasic
    open "fileIN.txt" for input as #1
    st=1
    Do Until EOF(1)
    Line Input #1, strInput
    x=instr(st,strInput,"page")
    if x > 0 then call Page_Break
    st=x +1
    Loop
    Close #1
    end
    '''''''''''page break
    Send page to printer or file

    -------------
    Does this help?
    There are several ways to do this, basically search the txt file for "page"

  11. #11
    Join Date
    Nov 2006
    Posts
    8
    The code in my form(MS Access form) is as follows:
    =========
    Option Compare Database

    Private Sub ReportToFile_Click()
    On Error GoTo Err_ReportToFile_Click

    Dim stDocName As String

    stDocName = "rptPAL"
    'DoCmd.OutputTo acReport
    DoCmd.OutputTo acReport, stDocName, acFormatTXT, "C:\file.txt"
    Open "fileIN.txt" For Input As #1
    st = 1
    Do Until EOF(1)
    Line Input #1, strInput
    x = InStr(st, strInput, "page")
    If x > 0 Then Call Page_Break
    st = x + 1
    Loop
    Close #1
    End

    Exit_ReportToFile_Click:
    Exit Sub

    Err_ReportToFile_Click:
    MsgBox Err.Description
    Resume Exit_ReportToFile_Click

    End Sub
    =========
    Could you please tell me what does this(Page_Break) function do? Sorry for the silly doubts I have.
    Thank you so much..

    -Rakheevissa

  12. #12
    Join Date
    Nov 2006
    Location
    North of San Francisco
    Posts
    19
    You said there are several pages. Search for the word that start a page.
    This could be "Page" or time or date or company name.
    When the new page is found.....call Page break.
    Remember, I do not know what your page (data) looks like. I am making lots of guesses.
    The page-break will maybe....open a file and write the page(data) out or send it to a printer or ?

Posting Permissions

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