stanmurphy
Technical User
- Oct 14, 2000
- 89
Hello All 
The code below is in the Click Event of a Delete button on a form that shows appointments in a grid. When I click the Delete button, the grid does not refresh to show that the appointment is deleted. SET DELETED is ON. If I close the form and reopen it, the deleted appointment is gone. The SELECT code is the same as that in the LOAD event of the form and it works fine when the form is loaded initially.
Any ideas??
************************************
SELECT appointments
SET ORDER TO iddatetime
RELEASE m.column1, m.column2, m.column3
STORE ALLTRIM(STR(curAppoint.clientid)) TO m.column1
STORE DTOC(curAppoint.apptdate) TO m.column2
STORE SUBSTR(m.column2,6,2) TO m.submonth
STORE SUBSTR(m.column2,9,2) TO m.subday
STORE SUBSTR(m.column2,1,4) TO m.subyear
STORE curAppoint.appttime TO m.column3
SEEK(ALLTRIM(m.column1)+ALLTRIM(m.subyear);
+ALLTRIM(m.submonth)+ALLTRIM(m.subday)+ALLTRIM(m.column3))
IF FOUND()
IF RLOCK()
DELETE NEXT 1
thisform.grdAppointments.RecordSource = ''
Select x.clientid, x.apptdate, x.appttime, y.counname,;
x.appttype, X.APPTNUM from appointments x;
left join counsellor y on x.counname = y.counname;
where x.clientid=m.clientid;
INTO CURSOR curAppoint ORDER BY x.apptdate
thisform.grdAppointments.RecordSource = 'curAPPOINT'
thisform.grdAppointments.Refresh
thisform.Refresh
ENDIF
ELSE
MESSAGEBOX(m.column1+" "+m.column2+" "+m.column3)
ENDIF
UNLOCK
thisform.Refresh()
RELEASE m.column1, m.column2, m.column3
The code below is in the Click Event of a Delete button on a form that shows appointments in a grid. When I click the Delete button, the grid does not refresh to show that the appointment is deleted. SET DELETED is ON. If I close the form and reopen it, the deleted appointment is gone. The SELECT code is the same as that in the LOAD event of the form and it works fine when the form is loaded initially.
Any ideas??
************************************
SELECT appointments
SET ORDER TO iddatetime
RELEASE m.column1, m.column2, m.column3
STORE ALLTRIM(STR(curAppoint.clientid)) TO m.column1
STORE DTOC(curAppoint.apptdate) TO m.column2
STORE SUBSTR(m.column2,6,2) TO m.submonth
STORE SUBSTR(m.column2,9,2) TO m.subday
STORE SUBSTR(m.column2,1,4) TO m.subyear
STORE curAppoint.appttime TO m.column3
SEEK(ALLTRIM(m.column1)+ALLTRIM(m.subyear);
+ALLTRIM(m.submonth)+ALLTRIM(m.subday)+ALLTRIM(m.column3))
IF FOUND()
IF RLOCK()
DELETE NEXT 1
thisform.grdAppointments.RecordSource = ''
Select x.clientid, x.apptdate, x.appttime, y.counname,;
x.appttype, X.APPTNUM from appointments x;
left join counsellor y on x.counname = y.counname;
where x.clientid=m.clientid;
INTO CURSOR curAppoint ORDER BY x.apptdate
thisform.grdAppointments.RecordSource = 'curAPPOINT'
thisform.grdAppointments.Refresh
thisform.Refresh
ENDIF
ELSE
MESSAGEBOX(m.column1+" "+m.column2+" "+m.column3)
ENDIF
UNLOCK
thisform.Refresh()
RELEASE m.column1, m.column2, m.column3