Set Default Value

  • Thread starter Thread starter Abdul Shakeel
  • Start date Start date
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.
 
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.
 
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
 
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.
 
Back
Top