i want to store a maximum of 90 record in a table. Each day a new record will be added so i want my code to count the number of records and if it over 90, delete the first record. Im fairly new to code so any help is appreciated. the code i have so far is
Function record_count()
Dim db As Database
Dim strSQL As String
Dim rs As Recordset
Set db = CurrentDb
strSQL = "SELECT Count([Trend Analysis].[reporting date]) AS [CountOfreporting date]FROM [Trend Analysis];"
Set rs = db.OpenRecordset(strSQL)
MsgBox rs.Fields(0)
If rs.Fields(0).Value > 90 Then
******************************
End If
End Function
I cant find any code for deleting records Any suggestion appreciated
Function record_count()
Dim db As Database
Dim strSQL As String
Dim rs As Recordset
Set db = CurrentDb
strSQL = "SELECT Count([Trend Analysis].[reporting date]) AS [CountOfreporting date]FROM [Trend Analysis];"
Set rs = db.OpenRecordset(strSQL)
MsgBox rs.Fields(0)
If rs.Fields(0).Value > 90 Then
******************************
End If
End Function
I cant find any code for deleting records Any suggestion appreciated