PLEASE!
I try to print a datareport and the second time, it dies and I get that error.
I am clicking New, then Save then Print. The methods are shown below ... any ideas. I am completely stumped.
Private Sub cmdEyeNew_Click()
On Error GoTo Err_New
Dim Counter As Integer
For Counter = 0 To txtEye.Count - 1
txtEye(Counter) = ""
Next Counter
newEyeRec = True
txtEye(0).Text = Format(Date, "MM/DD/YYYY"
txtEye(1).Text = cboDoc.Text
txtEye(2).SetFocus
Err_New:
End Sub
Private Sub cmdEyeSave_Click()
On Error GoTo err_Save
If (newEyeRec) Then
EyeRecSet.AddNew Array("rx_date", "doctor", "comments", "od_sphere", "os_sphere", "od_cylinder", "os_cylinder", "od_axis", "os_axis", "od_prism1", "os_prism1", "od_prism2", "os_prism2", "od_base1", "os_base1", "od_base2", "os_base2", "od_add", "os_add", "pat_num"
, Array(txtEye(0), txtEye(1), txtEye(2), txtEye(3), txtEye(4), txtEye(5), txtEye(6), txtEye(7), txtEye(8), txtEye(9), txtEye(10), txtEye(11), txtEye(12), txtEye(13), txtEye(14), txtEye(15), txtEye(16), txtEye(17), txtEye(18), txtPatient(0))
newEyeRec = False
Else
Dim Counter As Integer
For Counter = 0 To txtEye.Count - 1
If Not IsNull(txtEye(Counter)) Then EyeRecSet.Fields(Counter + 1) = txtEye(Counter)
Next Counter
EyeRecSet.Update
End If
EyeDirty = False
txtLastVisit.Text = txtEye(0).Text
txtLastEye.Text = txtEye(0).Text
MyRecSet.Fields(16) = txtLastVisit.Text
MyRecSet.Update
err_Save:
Label8.Caption = Err.Description
End Sub
Private Sub cmdEyePrint_Click()
On Error GoTo err_print
'cmdEyeSave_Click
If DataEnvironment1.rsEyeglasses.State = adStateOpen Then DataEnvironment1.rsEyeglasses.Close
MsgBox DataEnvironment1.Connections.State
DataEnvironment1.rsEyeglasses.Open "SELECT * FROM [patient_list], [Eyeglasses Rx] WHERE [Eyeglasses Rx].[pat_num] = " & CInt(txtPatient(0)) & " AND [patient_list].[pat_no] = [Eyeglasses Rx].[pat_num] AND [rx_date] = #" & txtEye(0) & "#", MyConn, 3, 3
MsgBox "testing"
PrintEye.PrintReport False
DataEnvironment1.rsEyeglasses.Close
err_print:
MsgBox Err.Description
End Sub
totally depressing
I try to print a datareport and the second time, it dies and I get that error.
I am clicking New, then Save then Print. The methods are shown below ... any ideas. I am completely stumped.
Private Sub cmdEyeNew_Click()
On Error GoTo Err_New
Dim Counter As Integer
For Counter = 0 To txtEye.Count - 1
txtEye(Counter) = ""
Next Counter
newEyeRec = True
txtEye(0).Text = Format(Date, "MM/DD/YYYY"
txtEye(1).Text = cboDoc.Text
txtEye(2).SetFocus
Err_New:
End Sub
Private Sub cmdEyeSave_Click()
On Error GoTo err_Save
If (newEyeRec) Then
EyeRecSet.AddNew Array("rx_date", "doctor", "comments", "od_sphere", "os_sphere", "od_cylinder", "os_cylinder", "od_axis", "os_axis", "od_prism1", "os_prism1", "od_prism2", "os_prism2", "od_base1", "os_base1", "od_base2", "os_base2", "od_add", "os_add", "pat_num"
newEyeRec = False
Else
Dim Counter As Integer
For Counter = 0 To txtEye.Count - 1
If Not IsNull(txtEye(Counter)) Then EyeRecSet.Fields(Counter + 1) = txtEye(Counter)
Next Counter
EyeRecSet.Update
End If
EyeDirty = False
txtLastVisit.Text = txtEye(0).Text
txtLastEye.Text = txtEye(0).Text
MyRecSet.Fields(16) = txtLastVisit.Text
MyRecSet.Update
err_Save:
Label8.Caption = Err.Description
End Sub
Private Sub cmdEyePrint_Click()
On Error GoTo err_print
'cmdEyeSave_Click
If DataEnvironment1.rsEyeglasses.State = adStateOpen Then DataEnvironment1.rsEyeglasses.Close
MsgBox DataEnvironment1.Connections.State
DataEnvironment1.rsEyeglasses.Open "SELECT * FROM [patient_list], [Eyeglasses Rx] WHERE [Eyeglasses Rx].[pat_num] = " & CInt(txtPatient(0)) & " AND [patient_list].[pat_no] = [Eyeglasses Rx].[pat_num] AND [rx_date] = #" & txtEye(0) & "#", MyConn, 3, 3
MsgBox "testing"
PrintEye.PrintReport False
DataEnvironment1.rsEyeglasses.Close
err_print:
MsgBox Err.Description
End Sub