Can Not Set Databound textbox value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sduprey
    New Member
    • Apr 2007
    • 1

    #1

    Can Not Set Databound textbox value

    I am trying to figure out how to set the default value of a bound textbox in the BindingNavigato rAddNewItem_Cli ck event.

    the code I have tried is:

    Me.TextBox1.Tex t = "Hello World"


    I am able to set the value if the textbox1 is not bound. But as soon as I bound it the "hello world" no longer displays.

    Thank you for any advice you can give me.

    Scott Duprey
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    When text box is bound it means it shows whatever is in a database and you can't put any data in it unless you update column to which text box is bound.
    When text box is unbound it means there is no data source behind it and you are free to enter anything.

    Irina.

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      You would probably need to set a default value for the field in the table definition. Or, if this is an Access form, I think there is a property which sets the default value for a control.

      Alternatively, depending on exactly what behaviour you're after, one of the Access form events might allow you to fill in a default before/after reading/displaying/saving the record.

      Comment

      Working...