Actually i need to count the image number by using sql statement and the value get from that statement need to assign variable named imageCount.
Here is code i write but didn't get output.So can anybody plz help me what is wrong with this code:
Sub countImage()
Dim cnn
Dim rs
Dim strSql As String
Dim imageCount As Integer
On Error Resume Next
strSql = "SELECT COUNT(*) AS 'counter' FROM IMAGES WHERE ([IMAGES].[IMAGE TYPE]='RADIOLOGY IMAGES' AND IMAGES.[PAT #]=" & Me![PAT #] & ");"
Set cnn = CurrentDb
Set rs = cnn.OpenRecordset(strSql)
With rs
If Not .EOF Then
imageCount = !counter(Note:I think this part is wrong need attention here)
End If
.CLOSE
End With
Set rs = Nothing
End Sub
Please reply me ass soon as possible.I really appreciate if sombody solve my problem.
Thank You..
Here is code i write but didn't get output.So can anybody plz help me what is wrong with this code:
Sub countImage()
Dim cnn
Dim rs
Dim strSql As String
Dim imageCount As Integer
On Error Resume Next
strSql = "SELECT COUNT(*) AS 'counter' FROM IMAGES WHERE ([IMAGES].[IMAGE TYPE]='RADIOLOGY IMAGES' AND IMAGES.[PAT #]=" & Me![PAT #] & ");"
Set cnn = CurrentDb
Set rs = cnn.OpenRecordset(strSql)
With rs
If Not .EOF Then
imageCount = !counter(Note:I think this part is wrong need attention here)
End If
.CLOSE
End With
Set rs = Nothing
End Sub
Please reply me ass soon as possible.I really appreciate if sombody solve my problem.
Thank You..