>I work in an aviation analysis section, I am new to VFP and would ike to create a form that would allow other analysts here to pull up a set of records by a specific date range and specified field such as a part number or a serial number and have it show an average for information like time needed for repair etc. I realize that this can be done by creating a query as well but I need a simple interface for users that are not familiar with VFP that I could incorporate into a menu to allow for this data to be extracted easily.
>
>Thanks,
>
>J.H. Score
Jeffrey,
Here's something you may be able to use:
Create a report in the report designer using your data table(s) with no criteria in it (all records included). Then create a form, add 'From' and 'To' text boxes for each of your fields (date, part # & serial #). Add a couple of buttons for 'Exit' and 'Run report'. In your 'Run report' button click event construct your filter into a character type memory variable, adding the search criteria for the fields where the user typed some info, i.e.
mfilter = ""
If User_Input_Field1
mfilter = mfilter + "mytable.field1>=ThisForm.TextBoxFrom1.Value and ";
mytable.field1<=ThisForm.TextBoxTo1.Value"
Endif
If User_Input_Field2 ... and so on and then:
Report Form MyReport For &mfilter To Printer
Or maybe you can put the mfilter variable to a Select - SQL Where clause to printer. HTH