Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter Issues using a form command button

Status
Not open for further replies.

snoopy92211

Technical User
Jun 29, 2004
67
0
0
US
Howdy folks! I tried to search on this one, but it didn't find any applicable info.

I have a form with several controls that serve as filter. I managed to fix all of my filter buttons with the exception of this one.

I have 2 calendar controls ...I'm trying to filter the data on a date range.

(how my form works: I have the controls to, from, color, size. At the top of my form, I have these same forms, but with a filter button next to them. The usr selects whatver criteria and the form filters with the data from the table.)

Here's my code and explanation behind the filter control.

me. references my form; the filters are named to and from, respectively. i'm actually trying to filter on the date field in my name table. I

'm geting this error:
Run-Time error 2448: I can't assign a value to this object.

Code:
Me.Filter = "Date = Between " & Me.from & " and " & Me.to & ""
Me.FilterOn = True
Form.Refresh

Any tips would be greatly appreciated.

Thanks!
snoopy
 
Try...

Me.Filter = "Date Between #" & Me.from & "# and #" & Me.to & "#"

Be careful of using VBA reserved words for control names. (Date), I'd use txtDate or DateStarted or InvoiceDate...


Either way, Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top