Steve-vfp9user
Programmer
Hello all
I have a form with multiple tables, the master table being CASMASTER.
The other tables on the forms Data Environment are linked to the master by the field MASTLINK in CASMASTER.
The form itself has a pageframe with grids on several pages displaying the relevant records linked to CASMASTER.
This works fine.
All the tables have a field called ACTDATE (D) which has an index tag called ACTDATE.
When the form is run, each respective pageframe page shows the linked records to CASMASTER so one page on the pageframe has expenses, another fuel etc.
As mentioned, each table shown on the pageframe has the field ACTDATE (D) but some of the records are not shown in date order for example (and these are UK dates):
18/06/2023
21/06/2023
14/04/2023
05/06/2023
What I am trying to achieve is to add a command line either on the pageframe1.page1 click event or the grids pageframe1.page1.grdCaactivity.column7.header1 so when I view the expenses page on the pageframe and click the ACTDATE will be in order, I have tried:
When I click the page in the pageframe or try the header1 option with the above command lines, the data shown in the grid disappears (no error messages are shown).
If I restart the form, the data is displayed so it’s definitely there and there is an index tag on ACTDATE
What am I missing or doing wrong here?
Thank you
Steve Williams
VFP9, SP2, Windows 10
I have a form with multiple tables, the master table being CASMASTER.
The other tables on the forms Data Environment are linked to the master by the field MASTLINK in CASMASTER.
The form itself has a pageframe with grids on several pages displaying the relevant records linked to CASMASTER.
This works fine.
All the tables have a field called ACTDATE (D) which has an index tag called ACTDATE.
When the form is run, each respective pageframe page shows the linked records to CASMASTER so one page on the pageframe has expenses, another fuel etc.
As mentioned, each table shown on the pageframe has the field ACTDATE (D) but some of the records are not shown in date order for example (and these are UK dates):
18/06/2023
21/06/2023
14/04/2023
05/06/2023
What I am trying to achieve is to add a command line either on the pageframe1.page1 click event or the grids pageframe1.page1.grdCaactivity.column7.header1 so when I view the expenses page on the pageframe and click the ACTDATE will be in order, I have tried:
Code:
thisform.pageframe1.page1.grdCaactivity.SetFocus
SET ORDER TO ACTDATE
GO TOP
thisform.pageframe1.page1.grdCaactivity.Refresh
When I click the page in the pageframe or try the header1 option with the above command lines, the data shown in the grid disappears (no error messages are shown).
If I restart the form, the data is displayed so it’s definitely there and there is an index tag on ACTDATE
What am I missing or doing wrong here?
Thank you
Steve Williams
VFP9, SP2, Windows 10