Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid white space
Message
From
04/11/2004 06:57:09
 
 
To
03/11/2004 15:11:20
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 5
Miscellaneous
Thread ID:
00957515
Message ID:
00958015
Views:
17
>Try This instead:
>
>In the form load method, define a cursor to use as the grid's RecordSOurce like this:
>
>
>SELECT * from MSTR WHERE 0=1 INTO CURSOR csrMstr READWRITE NOFILTER
>
>
>Now, in the form designer, set up your grid with the RecordSource of csrMstr and a RecordSourceType of 1-Alias. You can even lay out your columns visually using the MSTR table and editing the controlSources of the columns to point at csrMstr.
>
>Add a method to your form called ResetGrid. Then, when you need to change what is displayed in the grid, just use this code:
>
>
>Thisform.ResetGrid()
>
>
>This code in the form's ResetGrid() method:
>
>
>*** Rebuild the cursor used as the recordSource for the grid
>SELECT csrMstr
>ZAP
>lcWhere = [UPPER(inname) = '] + UPPER(TRIM(thisform.pageframe1.page1.text1.Value)) + [' and nam1 = '] + thisform.pageframe1.page1.text4.Value + [']
>SELECT * FROM MSTR WHERE &lcWhere INTO CURSOR Temp NOFILTER
>SELECT csrMstr
>APPEND FROM DBF( [Temp] )
>USE IN Temp
>GO TOP IN csrMstr
>IF RECCOUNT( [csrMstr] ) > 0
>  Thisform.PageFrame1.ActivePage = 2
>  Thisform.PageFrame1.Page2.Grid1.Refresh()
>ELSE
>  MESSAGEBOX( [No Records Match Your Criteria] )
>ENDIF
>
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform