Revert back to Default Value

J

jas580

Hello,

On a form, I have an unbound text box with a default value of 2. While in
form view, I can change the value of the text box. Now I want to create a
button on the form that, when clicked, will change the text box value back to
its default. Thanks for the help...

-jeff
 
K

KLZA

Hello,

On a form, I have an unbound text box with a default value of 2.  Whilein
form view, I can change the value of the text box.  Now I want to create a
button on the form that, when clicked, will change the text box value back to
its default.  Thanks for the help...

-jeff

use onclick event..Assuming your unbound text box is calle text0 and
button is called command2 use the follwing code.

Private Sub Command2_Click()
Text0 = 2
End Sub
 
S

sfisher973

A little more generic...

Private Sub Command2_Click()
Text0 = Text0.default
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top