Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox in form not updated
Message
 
 
To
27/12/2002 14:46:43
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00736152
Message ID:
00736172
Views:
13
You can put this code in the method, which calls Print Preview.

>Thank you Nadya for the codes,
>I'm not sure i understand the codes as i am not good in VFP.
>Where do i put this code? Should i put it as a method of the
>form and call this method at the valid() of all the controls?
>Tnanks for replying.
>JW
>
>
>>See the code bellow to fix the problem. In some cases (like using hotkeys to >activate buttons) the valid of textbox is not fired, thus the value is not updated.
>>
>>* code from  06/06/2002 Vlad Grynchyshyn
>>	local oObj, nIndex, i
>>	if type('thisform.activecontrol.name')='C'
>>		oObj = .activecontrol
>>&& If it's a grid, we need to calculate the active control
>>		if upper(m.oObj.baseclass) == "GRID"
>>			nIndex = m.oObj.activecolumn
>>			for i=1 to m.oObj.columncount
>>				if m.oObj.columns(m.i).columnorder = m.nIndex
>>					nIndex = m.i
>>					exit
>>				endif
>>			endfor
>>			oObj = m.oObj.columns(nIndex)
>>			oObj = evaluate("m.oObj." + m.oObj.currentcontrol)
>>		endif
>>
>>&& Check if control has different value than its ControlSource
>>		if proper(m.oObj.baseclass)='Textbox' and not empty(m.oObj.controlsource) ;
>>				and !(m.oObj.value==evaluate(m.oObj.controlsource))
>>			m.oObj.value = m.oObj.value && Updated:NN: 06/07/02
>>			lReturn = m.oObj.valid() && This is enough to write changes into ControlSource
>>			if (vartype(m.lReturn)='N' and m.lReturn = 0) or m.lReturn = .f.
>>				return .f.
>>			endif
>>		endif
>>	endif
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform