inability to change unbount textbox default value programmatically

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I'd like to be able to make the current value of a textbox on a form
the default value. Using the following code:

Debug.Print "orig", Me.tbxYear.DefaultValue
Me.tbxYear.DefaultValue = Me.tbxYear.Value
DoCmd.Save
Debug.Print "new", Me.tbxYear.DefaultValue

I am able to apparently change the default value... that is, the
default value change shows up in the immediate window, and after the
code has run, I can still print the control defaultvalue property in
the immediate window... (still changed), but when I close and reopen
the form, the default value has reverted to it's original value.
I CAN effect a change by changing the default value in the properties
dialog box. Why can't I do this programmatically?

.



Relevant Pages

  • Re: Pls Help - "between" Criterea returning no results
    ... I have done that and it returns the value exactly as I have it entered in the textbox ... i.e I entered "30000" in the textbox it returned "30000" in the immediate window ... Press ctrl-g. ... I also tried changing the text boxes to Combo boxes populating ...
    (microsoft.public.access.queries)
  • Re: inability to change unbount textbox default value programmatically
    ... I am able to apparently change the default value... ... default value change shows up in the immediate window, ... design change to keep it for the next time the form is ...
    (microsoft.public.access.formscoding)
  • Re: AfterUpdate Event not Running
    ... immediate window, as you suggested. ... Jim ... > txtVenName isn't an object until the userform is loaded. ... >> I went into a Userform and selected a textbox ...
    (microsoft.public.excel.programming)
  • Re: vb newbie help
    ... To move the insertion point to the end of the textbox (and thus scroll ... to the Immediate Window. ...
    (comp.lang.basic.visual.misc)
  • RE: test for ...expression that has no value
    ... > I've tested the values in the immediate window and it's clear that the error ... I have a function which is called from a textbox on a form. ... The function takes the value of a field form my query ... but that didnt trap the error either. ...
    (microsoft.public.access.forms)