|
-
Apr 30th, 2005, 04:35 AM
#1
Thread Starter
Lively Member
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.
-
Apr 30th, 2005, 07:30 AM
#2
Fanatic Member
Re: printing reports
How do you close the "invoice" form? Are you using
?
Perhaps
would work better?
-
Apr 30th, 2005, 08:15 AM
#3
Thread Starter
Lively Member
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
-
Apr 30th, 2005, 12:34 PM
#4
Re: printing reports
Try checking Invoice_Grouping's state if its open then close it first....
-
Apr 30th, 2005, 09:56 PM
#5
Thread Starter
Lively Member
Re: printing reports
Can you please provide me with the coding. I have no idea on this...
-
Apr 30th, 2005, 10:11 PM
#6
Re: printing reports
Your connection name may be different, but you have to do something like this:
VB Code:
DataEnvironment1.Connection1.Close
where Connection1 is the name of my connection to the DB.
-
May 1st, 2005, 04:10 AM
#7
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|