What is wrong with my code:
Private Sub Command20_Click()
Dim rs As DAO.Recordset
Dim year As Single
year = DMax("[Request Year]", "Request_Year")
MsgBox year
Set rs = CurrentDb.OpenRecordset(year)
With rs
.AddNew
![Request Year] = rs + 1
.Update
.Close
End With
Set rs = Nothing
I get a data type mismatch error in the bolded line, I am assuming it is a recordset problem. Any ideas?
Private Sub Command20_Click()
Dim rs As DAO.Recordset
Dim year As Single
year = DMax("[Request Year]", "Request_Year")
MsgBox year
Set rs = CurrentDb.OpenRecordset(year)
With rs
.AddNew
![Request Year] = rs + 1
.Update
.Close
End With
Set rs = Nothing
I get a data type mismatch error in the bolded line, I am assuming it is a recordset problem. Any ideas?