Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ActiveX calendar control not updating bound data field
Message
From
19/01/2006 15:42:06
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
ActiveX calendar control not updating bound data field
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Network:
Novell 6.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01088614
Message ID:
01088614
Views:
87
I've added code from the ...\Samples\Solution\Ffc\datacal.scx form to a form I've created. A button triggers the code, which shows the calendar control. But when I change the date, nothing happens. The bound data field is not updated, and [obviously] the textbox control whose record source is the same field is not updated. Is there a bug with this, or am I just doing something wrong? See code below... Thanks!
********** cmdButton.click procedure  ***************************
#DEFINE C_CALCAPTION_LOC	"Date Override Calendar"
lcDateTime = ALLTRIM(TTOC(DATETIME()))

***************************************************************************************
*** Code to generate calendar control for overriding current date in recovery process.*
***************************************************************************************
oCalForm = Create('form')
oCalForm.NewObject("oleCalendar","_olecalendar","..\triggers app\FFC\_datetime.vcx")
*!*	oCalForm.NewObject("oleCalendar","_olecalendar",HOME()+"FFC\_datetime.vcx")
WITH oCalForm.oleCalendar
	.date_column = "triggers.proc_date"
	.RefreshDisplay()
	.BackColor = THISFORM.BackColor
	.Visible = .T.
ENDWITH
WITH oCalForm
	.AutoCenter = .T.
	.BorderStyle = 2
	.MaxButton = .F.
	.MinButton = .F.
	.Height = oCalForm.oleCalendar.Height
	.Width = oCalForm.oleCalendar.Width
	.Caption = C_CALCAPTION_LOC
ENDWITH

oCalForm.Show(1)
THISFORM.Refresh

********** _olecalendar.SelChange procedure (which I have not modified)  ***********
*** ActiveX Control Event ***
LPARAMETERS startdate, enddate, cancel

nYear = YEAR(startdate)
nDay = DAY(startdate)
nMonth = MONTH(startdate)

dValue = DATE(m.nYear, m.nMonth, m.nDay)

cColumn = THIS.date_column

IF !EMPTY(m.cColumn)
	REPLACE &cColumn WITH m.dValue
ENDIF

IF TYPE("THISFORM")="O"
	THISFORM.Refresh
ENDIF
Next
Reply
Map
View

Click here to load this message in the networking platform