I am trying to set a TextBox's default value by using VBA code. Does anyone know how this can be done? I have tried the following:
Dim txtText1 As TextBox
Dim Val As Double
Set txtText1 = Forms!frmForm1.txtText1
Val = InputBox("Enter Value ", , 1.34)
txtText1.DefaultValue = Val
I have not entered anything for txtText1's "Default Value" property since I am trying to set the Default Value Property using the above VBA code. The above sets txtText1's value = whatever is entered in the InputBox, but the default value property for txtText1 remains blank.
Thanks much for any help.
Jim
Dim txtText1 As TextBox
Dim Val As Double
Set txtText1 = Forms!frmForm1.txtText1
Val = InputBox("Enter Value ", , 1.34)
txtText1.DefaultValue = Val
I have not entered anything for txtText1's "Default Value" property since I am trying to set the Default Value Property using the above VBA code. The above sets txtText1's value = whatever is entered in the InputBox, but the default value property for txtText1 remains blank.
Thanks much for any help.
Jim