P
Peder Aas
I have this code for updating an Option Box' values:
Dim M as Integer
M = Month(Now())
If M = 1 Or 2 Or 3 Or 4 Then
OptionBoxName.DefaultValue = 1
ElseIf M = 5 Or 6 Or 7 Or 8 Then
OptionBoxName.DefaultValue = 2
Else
OptionBoxName.DefaultValue = 3
End If
I have put the code in the Forms Form_Open part.
But I have problems. The Option Box do not update accordingly when I open
the form. It always show DefaultValue = 1. Any suggestions? What I want to
do is to let the month decide which default option value the Option Box
shows. The OptionBoxName.DefaultValue = 1 works OK when I check it in the
Immediate Window.
Thanks
Peder Aas
Dim M as Integer
M = Month(Now())
If M = 1 Or 2 Or 3 Or 4 Then
OptionBoxName.DefaultValue = 1
ElseIf M = 5 Or 6 Or 7 Or 8 Then
OptionBoxName.DefaultValue = 2
Else
OptionBoxName.DefaultValue = 3
End If
I have put the code in the Forms Form_Open part.
But I have problems. The Option Box do not update accordingly when I open
the form. It always show DefaultValue = 1. Any suggestions? What I want to
do is to let the month decide which default option value the Option Box
shows. The OptionBoxName.DefaultValue = 1 works OK when I check it in the
Immediate Window.
Thanks
Peder Aas