Y2K Question: ON CURRENT event??? 
Author Message
 Y2K Question: ON CURRENT event???

I am doing some Y2K program maintenance on VFP 3.0 and 5.0 apps for a
client at work.

Our client's requirements for Y2K compliance include forcing a user to
enter a date with a 4-digit year, i.e., date entry must be in mm/dd/yyyy
format.

I am aware of the SET CENTURY and ROLLOVER commands, but these affect date
display and windowing. VFP controls also do not seem to have any input mask
properties. Given these limitations, the only way I was able to force a
4-digit year date entry was by unbinding the text box, converting the text
box's date value to text, performing a validation on the result, and
rebinding the text box to the underlying table date field if successful.
This method works perfectly except for one hole. If the user moves to a
different record with the focus still in the text box, the text box remains
unbound. The consequence is that the value for the text box reflects the
text value for the preceding record.

Does VFP have an event that fires when a new record becomes current??? If
so, I would be able to rebind the text box to the table field.

I've looked through all the documention and on-line help with no luck. If
there is no such event, I'd be curious as to why such a useful event has
been omitted.

Thanks,
otanglin



Thu, 03 May 2001 03:00:00 GMT  
 Y2K Question: ON CURRENT event???
Otanglin,

Using VFP6 (which has increased Y2K support), dropping a textbox on a form
with the controlsource set to a date field, VFP automatically imposes that
you use 4-digit years. Can you recompile with VFP6?

You may already know this stuff, but since you may be new to VFP, I'll
include it anyway.

To re-bind an object to the controlsource, place the code in the object's
valid method. The valid method is triggered when you try to move away from
the object and is executed before the next object (or record) gets the
focus.

VFP does provide an inputmask property which is found under the "DATA" tab
of the properties box. It is often used in conjunction with the "FORMAT"
property.

Also, when you move from one record to another, the value of the recno()
function changes.

--
Brett Slattery

Quote:

>I am doing some Y2K program maintenance on VFP 3.0 and 5.0 apps for a
>client at work.

>Our client's requirements for Y2K compliance include forcing a user to
>enter a date with a 4-digit year, i.e., date entry must be in mm/dd/yyyy
>format.

>I am aware of the SET CENTURY and ROLLOVER commands, but these affect date
>display and windowing. VFP controls also do not seem to have any input mask
>properties. Given these limitations, the only way I was able to force a
>4-digit year date entry was by unbinding the text box, converting the text
>box's date value to text, performing a validation on the result, and
>rebinding the text box to the underlying table date field if successful.
>This method works perfectly except for one hole. If the user moves to a
>different record with the focus still in the text box, the text box remains
>unbound. The consequence is that the value for the text box reflects the
>text value for the preceding record.

>Does VFP have an event that fires when a new record becomes current??? If
>so, I would be able to rebind the text box to the table field.

>I've looked through all the documention and on-line help with no luck. If
>there is no such event, I'd be curious as to why such a useful event has
>been omitted.

>Thanks,
>otanglin



Thu, 03 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Refresh Problems - Refresh event send the current alias pointer to EOF

2. SQL current date question

3. grid_row current position question

4. question about counting current records.

5. Upsize Current VFP 7.0 to SQL Server Forms question

6. Y2K Question

7. Another Y2K Question

8. Y2K Question

9. Foxpro 2.5 for DOS - Y2K and new PC questions

10. Synchronization of events: Question.

11. Event driven - question.

12. 2 questions - Killing a form - The Unload Event

 

 
Powered by phpBB® Forum Software