Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I should know how to do this but....
Message
From
01/03/2002 10:40:06
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00626785
Message ID:
00626982
Views:
11
David,
I am not using the DBC for this project so I do not believe I can use a view. Here is the code that recreates the cursor and reconfigures grid1 on page 2:

LPARAMETERS cJob
thisform.lastselect=cJob
local wherestring
do case
case cJob='undone' && includes undone and undoneprint
wherestring='TRIM(tto)==TRIM(thisform.reader) and tdone=.f. and BETWEEN(tdate,thisform.beg_date,thisform.end_date)'
tf.mypf.page2.lblviewing.caption='Viewing Undone Messages'
case cJob='all' && includes all and allprint
wherestring='TRIM(tto)==TRIM(thisform.reader) and BETWEEN(tdate,thisform.beg_date,thisform.end_date)'
tf.mypf.page2.lblviewing.caption='Viewing All Messages'
case cJob='sent'
wherestring= 'TRIM(tfrom)==TRIM(thisform.reader) and BETWEEN(tdate,thisform.beg_date,thisform.end_date)'
tf.mypf.page2.lblviewing.caption='Viewing Sent Messages'
endcase

select tasks.*,RECNO() as nRec from tasks readwrite where ;
&wherestring into cursor mycursor
if _tally > 0
select mycursor
with thisform.mypf.page2
.grid1.recordsource=''
*.grid1.columncount=1
.grid1.recordsource='mycursor'
.grid1.column1.controlsource='mycursor.tdealer'
.grid1.column1.width=287
.grid1.column1.fontsize=12
.grid1.column1.header1.caption='Dealer Name'
.grid1.column1.header1.alignment=2
.grid1.column1.header1.fontsize=12
.grid1.column1.header1.fontbold=.t.
.eb1.controlsource='mycursor.tnotes'
* other fields which show on the pageframe
.txttcontact.controlsource='mycursor.tcontact'
.txttphone.controlsource='mycursor.tphone'
.txttfrom.controlsource='mycursor.tfrom'
.txttdate.controlsource='mycursor.tdate'
.txttdo_by.controlsource='mycursor.tdo_by'
.txttto.controlsource='mycursor.tto'
.txttdate_done.controlsource='mycursor.tdate_done'
.txttdone.controlsource='mycursor.tdone'
endwith
* the calling proc will activate page2 of the pageframe and display the data
return 1
else
* the calling proc will display a message that there are no recs.
return -1
endif

The code in the grid1.column1.text1 dblclick and keystroke events is:
Thisform.tasks('edit') which brings up another screen to edit the selected task.
A problem is a problem only as long as it has a possible solution. Lacking that, it becomes a FACT!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform