Fist let me say that I am new to access database. I have been working on a project for the last several weeks. I do not have much experience with programing but do understand the basics of rational databases.
I am trying to filter by a combo box then a textbox. If I filter by each of the separately the code works. If I try and put it together it breaks with a mismatch error.
The combo box code is
The Text box (Ruturn a count using Dcount of the number of records I want them to click it to filter)
When I try to run the click on textbox I get a mismatch runtime error 13
Is the me.filter the best way to do this? Or should I be looking at another type of filter method. I plan on adding several more textboxes. Each for the different record types with a dcount but all of them will need to update based on the User combo box.
I am trying to filter by a combo box then a textbox. If I filter by each of the separately the code works. If I try and put it together it breaks with a mismatch error.
The combo box code is
Code:
Private Sub CMBUser_AfterUpdate()
Me.Filter = "[User] Like " & Chr(34) & Me.CMBUser & "*" & Chr(34)
Me.FilterOn = True
Debug.Print Me.Filter
Me.Requery
End Sub
The Text box (Ruturn a count using Dcount of the number of records I want them to click it to filter)
Code:
Private Sub txtPPDateBefore_Click()
Me.Filter = "[User] Like " & Chr(34) & Me.CMBUser & "*" & Chr(34) And ([ProposedDestructionD] < Date & "()")
Debug.Print Me.Filter
Me.FilterOn = True
Me.Requery
End Sub
When I try to run the click on textbox I get a mismatch runtime error 13
Is the me.filter the best way to do this? Or should I be looking at another type of filter method. I plan on adding several more textboxes. Each for the different record types with a dcount but all of them will need to update based on the User combo box.