By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,404 Members | 2,512 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,404 IT Pros & Developers. It's quick & easy.

Delete content of a text control by code

Ericks
P: 74
What is the code for a button that deletes content of a text control called IntranetLink. The users should have the possibility to delete this link but I noticed that often they click on it with the intention to then hit the Del button. By then of course they are taken to where the link is pointing to. So a Delete button next to the control would make deleting the content more intuitive. I'm sure this is embarrassingly easy but right now my brain went numb.
Mar 5 '08 #1
Share this Question
Share on Google+
2 Replies


Expert Mod 2.5K+
P: 2,545
What is the code for a button that deletes content of a text control called IntranetLink. The users should have the possibility to delete this link but I noticed that often they click on it with the intention to then hit the Del button. By then of course they are taken to where the link is pointing to. So a Delete button next to the control would make deleting the content more intuitive. I'm sure this is embarrassingly easy but right now my brain went numb.
Hi. If this is the route you wish to go down it can be achieved by putting the following single VB line in the on-click event of the button:
Expand|Select|Wrap|Line Numbers
  1. Me!IntranetLink = Null
Alternatively you could set the value to a zero-length string.
Expand|Select|Wrap|Line Numbers
  1. Me!IntranetLink = ""
For the zero-length string method to work there must not be a table constraint set that disallows zero-length strings, otherwise an error would occur.

-Stewart
Mar 5 '08 #2

Ericks
P: 74
Thanks a lot. That did it.
Mar 5 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.