Results 1 to 7 of 7

Thread: printing reports(Resolved)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    81

    Resolved printing reports(Resolved)

    hi,

    I only can print the report once. If i print for the second time i have the run time errors " Operation is not allowed when the object is open. What can i do to avoid this. How to use refresh here?


    Private Sub Print_Click()

    DataEnvironment.Invoice_Grouping reg_no, inv_no
    Invoice.Show vbModal

    End Sub
    Last edited by vivian2u; May 1st, 2005 at 04:11 AM.

  2. #2
    Fanatic Member mateo107's Avatar
    Join Date
    Jan 2005
    Posts
    547

    Re: printing reports

    How do you close the "invoice" form? Are you using

    VB Code:
    1. Invoice.Hide
    ?

    Perhaps

    VB Code:
    1. Unload Invoice
    would work better?


    -Matthew-

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    81

    Re: printing reports

    Invoice is the report under desingers. its only allow to click on the grid once and get the report. If i click another record on the grid to print another report , i get run time errors " Operation is not allowed when the object is open. How can I solve this out?


    Private Sub MSFlexGrid1_Click()
    Dim inv_no As String
    Dim reg_no As Integer
    CurrentListRow = MSFlexGrid1.Row
    inv_no = Me.MSFlexGrid1.TextMatrix(CurrentListRow, 0)
    reg_no = Me.MSFlexGrid1.TextMatrix(CurrentListRow, 2)
    DataEnvironment.Invoice_Grouping reg_no, inv_no
    Invoice.Show vbModal

    End Sub

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: printing reports

    Try checking Invoice_Grouping's state if its open then close it first....
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    81

    Re: printing reports

    Can you please provide me with the coding. I have no idea on this...

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: printing reports

    Your connection name may be different, but you have to do something like this:

    VB Code:
    1. DataEnvironment1.Connection1.Close

    where Connection1 is the name of my connection to the DB.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    81

    Re: printing reports

    yes, i put DataEnvironment1.Connection1.Open and DataEnvironment1.Connection1.Close. it works, so i can reselect the record from the grid. Thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width