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.
Delete content of a text control by code
Collapse
X
-
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:Originally posted by EricksWhat 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.
Alternatively you could set the value to a zero-length string.Code:Me!IntranetLink = Null
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.Code:Me!IntranetLink = ""
-Stewart
Comment