Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I clear textbox controls?
Message
From
13/11/1997 11:04:00
 
 
To
12/11/1997 20:45:18
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00059638
Message ID:
00059945
Views:
32
>>>>I want to clear textbox controls after fill out a form for filling out the same form again but with textbox controls cleared.
>>>>what do I have to do?
>>>Hi Alberto.
>>>
>>>Are the textboxes on the form bound to a table? Are you adding a new record to the table? If so, try thisform.Refresh() after you append blank. If the textboxes aren't bound, you will have to go through something like:
>>>
>>>for lni = 1 to thiform.controlcount
>>> thisform.controls[i].value = ""
>>>endfor
>>>
>>>Of course, this only works if all the controls have values that are character. You really should check for type(thisform.controls[i]) and take appropriate action in a case statement. And thisform.refresh() afterward.
>>>
>>>Marcia
>>
>>Unfortunately this will set all of your labels to '' also :-( If your controls are bound, then add a blank record as Dave Johns suggested. If they are unbound, then have a form method which sets the value of each textbox in turn and then calls a form refresh.
>>
>>HTH
>>Barbara
>Hi Barabra.
>
>Whoops! Forgot about the labels:-) Thanks.
>
>Marcia

Huh?!? Labels don't have a value property (not base VFP labels anyway)! They have a caption property. But the above code might return an error 'unknown property or event' or some such, when you try to set the value of a label.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform