Hi there, I'm relatively new to Access and I have a problem which I can't seem to figure out!
I have created a form for a table which contains ~600 movies and their name, genre, rating, director, year it was made, and length (min).
Here's what my form looks like:
imgur .com/Mwu7qV4
I need to be able to enter numbers into the two Year boxes, and then it filters the movies in my database and only shows me records from between those two years. The years in my database are just in one column in the format of: XXXX e.g. 1996 etc
I've tried the code:
Year1 and Year2 are the boxes Year: and To: respectively. [Year] just being the column name which contains all my years.
When I try to run my query it shows me my records, but it shows me all of them! It doesn't filter it at all!
Any help would be very much appreciated!
I have created a form for a table which contains ~600 movies and their name, genre, rating, director, year it was made, and length (min).
Here's what my form looks like:
imgur .com/Mwu7qV4
I need to be able to enter numbers into the two Year boxes, and then it filters the movies in my database and only shows me records from between those two years. The years in my database are just in one column in the format of: XXXX e.g. 1996 etc
I've tried the code:
Code:
Private Sub Year2_AfterUpdate()
Me.Filter = "[Year] BETWEEN" & Me.Year1 & "AND" & Me.Year2
Me.Filteron = True
Debug.Print "[Year] BETWEEN" & Me.Year1 & "AND" & Me.Year2
End Sub
Year1 and Year2 are the boxes Year: and To: respectively. [Year] just being the column name which contains all my years.
When I try to run my query it shows me my records, but it shows me all of them! It doesn't filter it at all!
Any help would be very much appreciated!
