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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter criteria

Status
Not open for further replies.

cobweb

IS-IT--Management
May 5, 2002
95
GB
Hello there:

I am running a query that I would like to specify by a date; the date being different each time I run it.
At the moment I am going into the design of the query and rekeying the date in the appropriate field, then running the amended query.
Does Paradox 9 have a mechanism that allows me to enter the date on a form, then the query accepts that date as the selection criteria?

I am sure it does!!
 
Yes, but it requires some coding on your part. Here is a simple pushbutton example. You would need to insert your own query, obviously, using your own table names and aliases. The example assumes you have an unbound field on your form named date_field:

Code:
var
   qVar   Query
   qDate  string
   r      report
endvar

if date_field.value = ""  then 	
     MsgStop("Error!","You must specify a date")
     return
endif

qDate=date_field.value

qVar= Query

:myAlias:myTable.db | Date         | Names  |
		            | Check ~qDate | Check  |

EndQuery

if not qVar.executeQBE(":priv:answer.db")
    then errorShow()
endIf

if isempty(":priv:answer.db")
   then  MsgInfo("Error","No records found")
         return
endif

if not r.load(":myAlias:myReport",WinStyleDefault+WinStylehidden)
	then errorshow()
endif

if not r.print()
	then errorshow()
endif

if not r.close()
	then errorshow()
endif


This is a simple example. Not too much code to worry about. I'm sure others have different ways to do it.

Mac :)

"Do not delve too deeply in the arts of your enemy and so become ensnared by them"

langley_mckelvy@cd4.co.harris.tx.us
 
Thanks a lot for the advice; as helpful as ever!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top