I have zero experience with writing code, but what I have read in a vba book for dummies. I am trying to create a recordset then filter all records by using a user inputted year variable (myYear). I have been able to write the code neccessary to get the recordset, but that has been it. Every time I try to manipulate the recordset to get a specific year I get errors.The varible myYear is being pulled from a textbox on a form called frmExport. My goal is to find all records for let say "2005"(as a user variable". My intentions is to enventually send this data to an Excel file and delete from the database
Private Sub Command)_Click()
Dim db as DAO.Database
Dim rs as DAO.Recordset
Dim myYear as String
Set db = CurrentDb
If IsNull(Forms!frmExport!Text1.Value) Then
MsgBox "You have not entered a year to Export."
Me!Text1.SetFocus
End If
myYear = Me!Text1.Value
Set rs = db.OpenRecordset("tblFixed"' dbOpenTable)
End Sub
Thanks for any help.
Don
Private Sub Command)_Click()
Dim db as DAO.Database
Dim rs as DAO.Recordset
Dim myYear as String
Set db = CurrentDb
If IsNull(Forms!frmExport!Text1.Value) Then
MsgBox "You have not entered a year to Export."
Me!Text1.SetFocus
End If
myYear = Me!Text1.Value
Set rs = db.OpenRecordset("tblFixed"' dbOpenTable)
End Sub
Thanks for any help.
Don