Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date Filter on Form doesn't work properly
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Date Filter on Form doesn't work properly
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01461572
Message ID:
01461572
Views:
208
I have a method called SetDateFilter at the form-level which doesn't work correctly; it looks okay, but doesn't do the job. It filters out all of the data, no matter what the Dates are. The user enters a date range, a FROM date and a THRU date. The table's name is QUOTES. The field in question is called "dQuote" for the data of the Quote. When I use this and give a range of known good records, the table goes to EOF, which isn't quite what I was looking for. And, sometimes I get an error message on my variable below called "dThru".

Here's my code:
WITH ThisForm
	IF NOT EMPTY(.txtDateFrom.Value) AND ;
			NOT EMPTY(.txtDateThru.Value)
		dFrom = CTOD(.txtDateFrom.Value)
		dThru = CTOD(.txtDateThru.Value)
		SET FILTER TO BETWEEN(Quotes.dQuote, dFrom, dThru)
		GO TOP
		.Refresh()
	ENDIF
ENDWITH
Next
Reply
Map
View

Click here to load this message in the networking platform