Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print via myform
Message
From
08/11/2004 14:47:36
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
08/11/2004 14:16:12
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 5
Miscellaneous
Thread ID:
00959007
Message ID:
00959317
Views:
8
>hi,
>
>i mean if you can have another way to rewrite mycdoe,to get that data
>
>as mygrid.
>
>thanks
>m.qasem

Yes, I usually prefer to put data into a cursor, for a report.

Your orginal code:
locate for UPPER(inname) = UPPER(TRIM(thisform.pageframe1.page1.text1.Value)) and nam1 = thisform.pageframe1.page1.text4.Value and datein>=thisform.pageframe1.page1.text3.value .and. datein<=thisform.pageframe1.page1.text5.value 
if found()
    set filter to UPPER(inname) = UPPER(TRIM
     (thisform.pageframe1.page1.text1.Value))    
     and nam1 =thisform.pageframe1.page1.text4.Value and     
     datein>=thisform.pageframe1.page1.text3.value .and. 
     datein<=thisform.pageframe1.page1.text5.value

     report form mstr22 preview
else
  =messagebox("not found")
endif
Changing this to SELECT:
select from MyTable where UPPER(inname) = UPPER(TRIM
     (thisform.pageframe1.page1.text1.Value))    
     and nam1 =thisform.pageframe1.page1.text4.Value and     
     datein>=thisform.pageframe1.page1.text3.value .and. 
     datein<=thisform.pageframe1.page1.text5.value;
  into cursor TempReport;
  nofilter
if _tally = 0
  MessageBox("No records selected. Try changing your criteria.")
else
  report form ...
endif
select ... && go back to the table that belongs to the grid
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform