When i view my report got this error, runtime error '94' invalid use of null, but my database all have data?? if i use 'on error resume next' will blank report. Anyone can help me to re-solve this problem,Thank you.
your help is much appreciated.
Public Sub SumSH()
RS1Check
rs1.Open "Select sum(sh) From Daily where dt between #" & DTPicker2 & "# and #" & DTPicker3 & "#", cn, adOpenDynamic, adLockPessimistic
Text1.Text = rs1.Fields(0) 'THIS LINE CAUSE THE ERROR[/color]
End Sub
Private Sub ViewReport_Click()
On Error GoTo 0
If MsgBox(" View Report?", vbYesNo, "View Report") = vbYes Then
DataReport1.Orientation = rptOrientLandscape
DataEnvironment1.Commands(1).CommandText = "Select * From Daily Where Dt Between #" & DTPicker2 & "# and #" & DTPicker3 & "# Order by Dt"
DataReport1.Show
SumSH
Load DataEnvironment1
With DataEnvironment1
If .rsCommand1.State <> 0 Then .rsCommand1.Close
.Command1
End With
Else
Cancel = 1
End If
End Sub

New Topic/Question
Reply



MultiQuote





|