Link to home
Start Free TrialLog in
Avatar of KP_SoCal
KP_SoCalFlag for United States of America

asked on

Use a message box to change to default value of a control.

I'm looking for a block of code that allows an end-user to permanently change the default value of a form control Me.txtName via whatever value is typed in an input box.

I've searched high and low on the internet, and have not found anything that would accomplish this.  As soon as the form is closed, the default value reverts back to what I manually set in the default properties window.

Any help is greatly appreciated.
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In Excel you can use Application.Names.Add and the Evaluate method to store and recall values within the application, but assuming that that doesn't apply to Access then depending on the OS you can save and recall the value from an Access table, ini file, regular text file or the Registry. Since this is Access the Access table seems to be the natural choice.
Avatar of KP_SoCal

ASKER

I didn't think it was possible either without going in to Design View.  I thank you both for pointing me in the right direction on this.
Just curious ... and this is certainly not a big deal of any kind, but ... the Accepted Answer talks about Excel ... the concurs with what I said about using a Table ... so, just wondering why you didn't reverse Accepted  and Assisted ?

mx
Sorry, I didn't even notice their was an "Accepted" and "Assisted".  My mistake.
Yes I agree. You should get most if not all of the points since, while I didn't notice it when I posted, you were first.
'Request Attention' and the moderators will reopen the question.
Ok, I'm requesting the moderator to open.  My apologies for the mix-up.
And my comment had nothing to do with points :-)