Hi All,
Its been a couple of years since I have done any VBA coding in Access 2K. I have a problem with trying to get the RecordCount out of a result set.
Here is the code. Its probably an easy solution but I just cant seem to solve it.
Dim StrSql1, StrSql2, StrSql3, StrSql4, OnOpen, StrSql As String
StrAccepted = "ACCEPTED"
StrOpen = "OPEN"
StrAwaiting = "AWAITING"
StrSql2 = "SELECT " & AppType & ".Status, " & AppType & ".[Date/time entered] From " & AppType & ""
StrSql3 = " WHERE ((([" & AppType & "].[Status])=""" & StrAccepted & """ Or ([" & AppType & "].[Status])=""" & StrOpen & """ Or ([" & AppType & "].[Status])=""" & StrAwaiting & """ AND (([" & AppType & "].[Date/time entered])>=#" & MonDate & "# And ([" & AppType & "].[Date/time entered])<=#" & FriDate & "#)) ;"
StrSql = StrSql2 & StrSql3
CurrentDb.QueryDefs("GIT_Assigned".SQL = StrSql
Dim rs1 As Recordset
rs1 = CurrentDb.OpenRecordset("GIT_Assigned"
Dim total As Integer
total = rs1.RecordCount
Debug.Print total
Any help/advice will be greatly appreciated
Many Thanks
James
Its been a couple of years since I have done any VBA coding in Access 2K. I have a problem with trying to get the RecordCount out of a result set.
Here is the code. Its probably an easy solution but I just cant seem to solve it.
Dim StrSql1, StrSql2, StrSql3, StrSql4, OnOpen, StrSql As String
StrAccepted = "ACCEPTED"
StrOpen = "OPEN"
StrAwaiting = "AWAITING"
StrSql2 = "SELECT " & AppType & ".Status, " & AppType & ".[Date/time entered] From " & AppType & ""
StrSql3 = " WHERE ((([" & AppType & "].[Status])=""" & StrAccepted & """ Or ([" & AppType & "].[Status])=""" & StrOpen & """ Or ([" & AppType & "].[Status])=""" & StrAwaiting & """ AND (([" & AppType & "].[Date/time entered])>=#" & MonDate & "# And ([" & AppType & "].[Date/time entered])<=#" & FriDate & "#)) ;"
StrSql = StrSql2 & StrSql3
CurrentDb.QueryDefs("GIT_Assigned".SQL = StrSql
Dim rs1 As Recordset
rs1 = CurrentDb.OpenRecordset("GIT_Assigned"
Dim total As Integer
total = rs1.RecordCount
Debug.Print total
Any help/advice will be greatly appreciated
Many Thanks
James