Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid white space
Message
From
04/11/2004 05:22:44
 
 
To
03/11/2004 14:22:57
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 5
Miscellaneous
Thread ID:
00957515
Message ID:
00957998
Views:
15
Don't quite follow what you mean by:

>-how i can see the result directly at page2,after i press at thisform.text1.value,
>-

If the problen is not getting any data into the grid after the select then:

1. there are problems in using form properties, e.g. thisform.cSeekkey in SQL statements. What many people do is set a var to this before, e.g. lcSeekKey = thisform.cSeekKey, and use the var in the SQL. I don't know if this applies to object properties, such as thisform.pageframe1.page1.text1.Value
2. In your case you can't do this because the SQL is imbedded in the grid's properties.
3. What I'd do is
- place the code in a form method, e.g. thisform.lmGridSQL
- select into a cursor as you've done. OH! I've just noticed - I'm not sure the grid will know it's source as it doesn't "know" it's supposed to get the data from your cursor.
- As above, use a local var in the SQL
- your SQL can be followed with testing for an empty curso (if the select failed).
- if no data put up the message("not found").
ELSE
do the code to populate the grid, as normal. REMEMBER change the recordsourcetype of the grid to default, and the recordsource to your cursor.
- refresh the cursor.
- You don't need to set the .RecordsourceType = 0 every time - set it in its property sheet.
- When you "presss the button" to do the search, call the above method.

HTH but I'm very busy today and can't get into a lengthy talk. Good luck

Terry

>hi,
>
>-i try as under but still,
>-how i can see the result directly at page2,after i press at thisform.text1.value,
>-if my select statment not found where i can put amessage ("not found")
>and stay at page1 as setfocus.
>
>with thisform.pageframe1.page2.Grid1
>    .RecordsourceType = 4 && SQL
>    .Columncount = -1
>      .Recordsource = 'select * from mstr'+;
>      '   where UPPER(inname) = UPPER(TRIM(thisform.pageframe1.page1.text1.Value)) and nam1 = thisform.pageframe1.page1.text4.Value'+;
>      '   into cursor crsMyCursor'
>
>ENDWITH
>
>thisform.pageframe1.page2.Grid1.refresh
>
>
>thanks.
>m.qasem
- 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