Here is a code snippet in my Report:
** Snippet starts here *************** *********
Private Sub GroupHeader0_Fo rmat(Cancel As Integer, FormatCount As
Integer)
Dim sSQL As String, strSQL0 As String
Dim OpBal_Mst, OPBAL As Double
' ***** Op.Bal from Master-File ... DPATMST *****
strSQL0 = "SELECT Sum(nz(DPATMST.[OPBAL])) AS OpBal_Sql" & _
" FROM DPATMST" & _
" WHERE DPATMST.Code = " & Me.txt_Code.Val ue
OpBal_Mst = Nz(CurrentDb(). OpenRecordset(s trSQL0)!OpBal_S ql, 0)
** Snippet ends here *************** ***********
At times I get an error msg where Access highlights the above SQL
Statement & says:
RunTime Error 2427
You entered an expression that has no value.
I realized that the problem is with Me.txt_Code.Val ue which is a Text
Box in my Report in the Group Header Section.
Can anyone please throw some light on this ?
Thx & Best Rgds,
Prakash.
** Snippet starts here *************** *********
Private Sub GroupHeader0_Fo rmat(Cancel As Integer, FormatCount As
Integer)
Dim sSQL As String, strSQL0 As String
Dim OpBal_Mst, OPBAL As Double
' ***** Op.Bal from Master-File ... DPATMST *****
strSQL0 = "SELECT Sum(nz(DPATMST.[OPBAL])) AS OpBal_Sql" & _
" FROM DPATMST" & _
" WHERE DPATMST.Code = " & Me.txt_Code.Val ue
OpBal_Mst = Nz(CurrentDb(). OpenRecordset(s trSQL0)!OpBal_S ql, 0)
** Snippet ends here *************** ***********
At times I get an error msg where Access highlights the above SQL
Statement & says:
RunTime Error 2427
You entered an expression that has no value.
I realized that the problem is with Me.txt_Code.Val ue which is a Text
Box in my Report in the Group Header Section.
Can anyone please throw some light on this ?
Thx & Best Rgds,
Prakash.
Comment