|
-
Sep 10th, 2002, 09:09 PM
#1
Thread Starter
New Member
Passing Parameters runs Once Only
Hello All
Im having trouble with my DataReport. It works perfectly when run the first time. However when the button is run for a second time nothing occurs. and the report doesnt seem to show,
I suspect its something to do with how the parameters are being passed.
Heres the code :
Private Sub cmdPrint_Click()
On Error GoTo err_click
'This sub must handle the name, order number and options
'and process them into queries which print the applicable reports
'!! Must also handle the process types of each order!!
Dim OrderNoStr As Variant
Dim Stk As String
Dim Weight As String
Dim Nameval As String
Dim DateVal As String
'Checks Order Number Value
Nameval = Me.lstNames.Text
If Me.dCboOrderNo.Text = "" Then
MsgBox ("An Order Number must be entered")
Exit Sub
Else
OrderNoStr = Me.dCboOrderNo.Text
End If
'Enters Todays Date if Checked
If chkDate.Value = 1 Then
DateVal = Now()
Else
DateVal = ""
End If
'Ask for Weight if Checked
If Me.ChkWeight.Value = 1 Then
Weight = InputBox("Enter the Weight Value", "Enter Weight")
Else
Weight = ""
End If
'Asks for Code if checked
If Me.ChkStock.Value = 1 Then
Stk = InputBox("Enter the Required code", "Enter Code")
Else
Stk = ""
End If
'Checks either cutting or rewind job
If Me.OptCutting.Value = True Then
DataBackend.qryReportCutting Weight, Stk, DateVal, Nameval, OrderNoStr
LabelsCutting.Show
LabelsCutting.PrintReport (True)
'LabelsCutting.Show
Else
DataBackend.qryReportCutting Weight, Stk, DateVal, Nameval, OrderNoStr
LabelsRewind.Show
LabelsRewind.PrintReport (True)
End If
'Different reports exist for different process types.
'Passes the Parameters to the query
'DataBackend.qryReportCutting Weight, Stk, DateVal, OrderNoStr
err_click:
Exit Sub
End Sub
Could some please give me a hand.
Thanks Alot
Smurfaroonies
-
Sep 12th, 2002, 03:00 AM
#2
Frenzied Member
Maybe you can try to put something in your error handler.
It could be an error occurred and therefore you see nothing happen.
You better change
VB Code:
err_click:
Exit Sub
End Sub
to
VB Code:
Exit Sub
err_click:
End Sub
Code:
If Question = Incomplete Then
AnswerNextOne
Else
ReplyIfKnown
End If
cu Swatty
-
Sep 12th, 2002, 03:25 AM
#3
Lively Member
Just close the query in the datareport's queryclose event as shown:
Private Sub DataReport_QueryClose(Cancel As Integer, CloseMode As Integer)
DataEnvironment1.rsCommand1.Close
End Sub
Your attitude determines your altitude!!!
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
|