I created a form in VFP 9.0 and when the form is initiated a code runs, which makes it possible to create (based on a table) a Pageframe which could have between 2 and much more pages and each page has a different caption.
That works fine.
Coding:
SET SAFETY OFF
SELECT DISTINCT KATEGORIE FROM GOOGLEA INTO TABLE MYTABLE
USE MYTABLE
GO TOP
THISFORM.PAGEFRAME1.PAGECOUNT = RECCOUNT()
*CAPTION FOR EACH PAGE TO BUILD
SCAN
STORE KATEGORIE TO MKATEGORIE
THIS.PAGES(RECNO()).CAPTION = MKATEGORIE
ENDSCAN
Example: Caption of Page 1 = "Wood", Caption of Page 2 = "Iron", Caption of Page 3 = "Coal".
Now, i would like that when the user clicks on page 1 that all records are shown which are of category "Wood", and when he clicks on Page 2 of the Pageframe that "Iron" and so on.
So every click on a page should do the same which means : "Show me records of a file which contains something which is the same as the caption is."
Of course it would be easy to write a fixed code if it would be only and always 3 pages, but as I mentioned it could also be much more, depending of what the dbf.file will receive.
My question:
Where is the best place in the form, to locate such a code?
How would it look?
Thanks in advance
Klaus
Peace worldwide - it starts here...
That works fine.
Coding:
SET SAFETY OFF
SELECT DISTINCT KATEGORIE FROM GOOGLEA INTO TABLE MYTABLE
USE MYTABLE
GO TOP
THISFORM.PAGEFRAME1.PAGECOUNT = RECCOUNT()
*CAPTION FOR EACH PAGE TO BUILD
SCAN
STORE KATEGORIE TO MKATEGORIE
THIS.PAGES(RECNO()).CAPTION = MKATEGORIE
ENDSCAN
Example: Caption of Page 1 = "Wood", Caption of Page 2 = "Iron", Caption of Page 3 = "Coal".
Now, i would like that when the user clicks on page 1 that all records are shown which are of category "Wood", and when he clicks on Page 2 of the Pageframe that "Iron" and so on.
So every click on a page should do the same which means : "Show me records of a file which contains something which is the same as the caption is."
Of course it would be easy to write a fixed code if it would be only and always 3 pages, but as I mentioned it could also be much more, depending of what the dbf.file will receive.
My question:
Where is the best place in the form, to locate such a code?
How would it look?
Thanks in advance
Klaus
Peace worldwide - it starts here...