Set Default Value

A

Abdul Shakeel

Is there any way to set default value through Command Button for example if
the field of a table have value Apple so by pressing command button it will
consider default value for ongoing records.
 
B

boblarson

Yes, you can do that. You can set the default for a text box, for example by:

Me.YourTextBoxNameHere.Default = "Apple"

and it will stay that way until you change it or until you close the form.
It will revert to it's value that was set in design view when you reopen the
form, but it will stay as long as you have the form open and don't close it.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.
 
A

Abdul Shakeel

Dear Bob

Your code work properly but I want that if my field current value is "Apple"
so by pressing a particular command button its become the default value &
after 10-15 records if I enter "Mango" in that field and press cmd btn then
Mango become the default value, morover I want all the things do by a command
button
 
B

boblarson

Then just put the code in the click event of the command button. And to set
it to what it currently displays use:

Me.YourTextBoxNameHere.Default = Me.YourTextBoxNameHere
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.
 

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