Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to bind TEXT property to database instead of VALUE
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00187074
Message ID:
00187294
Views:
20
>Thanks for the info. These are all great ideas. I am curious about the last idea to place an input mask on the database field... What if I have a mask on the table field like "99:99", and then I try to save "12:00" to it (with the colon)?

REPLACE MyField WITH "12:00"

saves "12:00" into MyField when Myield's input mask is set to "99:99"

the problem comes when you:

REPLACE MyField WITH "1200"

then you get "12:0"

in the field.

But the cool thing about setting properties in the dbc like this, is that VFP allows you to specifiy that these propreties should come over to the textbox when you drag a field from the DE tothe form.

Or, if you use a textbox class (which you should be doing) , you could put code like this in it's init event:
IF !EMPTY(THIS.ControlSource)
    lcINputMask = DBGETPROP(THIS.ControlSource, "field", "inputmask")
    IF !EMPTY(THIS.InputMask) AND !EMPTY(lcInputMask)
        THIS.InputMask = lcInputMask
    ENDIF
ENDIF
and your input mask will always trickle down from the dbc to the control that is bound to that field.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform