Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form does not save change to textbox default value property 1

Status
Not open for further replies.

tessian

Programmer
Jul 14, 2003
3
US
Good Morning,

I have a form with a text box on it. The text box is assigned a default value manually when I design the form.

I want the default value to change to the last value entered into it. So I have some code that looks like this, where the variable name contains the value that I want the default value property changed to.

Forms!Import_Time_Data!.mailbox_name.SetFocus
Forms!Import_Time_Data!.mailbox_name.DefaultValue = "=" & quote & name & quote
DoCmd.Save acForm, "Import_Time_Data"


The problem is that the changes are not saved. I can look at the properties window and see that the value for the DefaultValue property has changed properly. However, the changes are not saved when the form is closed.

Does any one have any solutions?

Thanks in advance for any assistance.

 
I don't believe you can save the DefaultValue property in Form View or Datasheet View. You must be in Design View for the DefaultValue to "Stick" after you close the form. What you may have to do is to create a table that contains your default values. At startup, open the table and then set you default values based on the values from the table.
 
Thanks for the information. Are you aware of any documentation on which properties can't be changed unless in design view. I just tried caption and it seems to have the same problem. I thought that if you had set the allowchanges property for the form to true that one should be able to change any property for the form or any of its controls.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top