The previous thread helped some, but now....
I have looked on the net etcetra, but still don't see how you use a form to set the default value of a field from a form control.
The previous thread helped some, but now....
I have looked on the net etcetra, but still don't see how you use a form to set the default value of a field from a form control.
in the property of the text box on the form...
DEFAULT VALUE
set it to what you want.
I didn't state it clearly enough. I do not want the use to go into the form properties, but to have a button/radial/toggle means to change the default. The default would be changed periodically.
I have a table , tConfig.
it has my default settings for certain things.
at form load event, load your 'default'
txtBox = Dlookup("[setting],"tConfig","[field]='Qty'")
I have this so far: It works where I can choose the value of NIE.
Private Sub Form_Load()
Me![NIE].Visible = False
End Sub
Private Sub NIE_Def_Click()
If Me![NIE_Def] = True Then
Me.[NIE].Visible = True
Else
Me.[NIE].Visible = False
End If
End Sub
I am thinking that I need to have a formula in the Forms NIE field under default for this to work correctly. This is what I am trying to change on the fly.
Thanks
(1 line)
Private Sub NIE_Def_Click()
NIE.Visible = NIE_Def
if you just want to assign the default value, just assign it.... txtbox = MyDefltvalue
Thanks ranman256. The one liner worked.
Does the txtbox = MyDefltvalue set the value until it is changed? I tried it by doing the following:
Private Sub NIE_Def_Click()
txtbox = MyDefltvalue
NIE.Visible = NIE_Def
END SUB
It makes the first record in the table change the NIE Value, but when I input a new record, it equals the lowest value in the list.