N
NuBie via AccessMonster.com
1. i want to set the unbound text depending on what the user selects from
grpMonths (option buttons)
2. why i couldn't set unbound text, text property without set the focus to
the control. (runtime error 2115)
any other way to accomplish this?
code below:
Private Sub grpMonths_Click()
Dim strYear As String
If grpMonths.Value = 10 Or grpMonths.Value = 11 Or grpMonths.Value = 12
Then
If Format(Now(), "mmm") = "Oct" Or Format(Now(), "mmm") = "Nov" Or
Format(Now(), "mmm") = "Dec" Then
strYear = Year(Now())
Else
strYear = Year(Now()) - 1
End If
Else
strYear = Year(Now())
End If
strDate = grpMonths.Value & "/1/" & strYear
' lines below is my problem
EndDate.SetFocus
EndDate.Text = strDate
End Sub
grpMonths (option buttons)
2. why i couldn't set unbound text, text property without set the focus to
the control. (runtime error 2115)
any other way to accomplish this?
code below:
Private Sub grpMonths_Click()
Dim strYear As String
If grpMonths.Value = 10 Or grpMonths.Value = 11 Or grpMonths.Value = 12
Then
If Format(Now(), "mmm") = "Oct" Or Format(Now(), "mmm") = "Nov" Or
Format(Now(), "mmm") = "Dec" Then
strYear = Year(Now())
Else
strYear = Year(Now()) - 1
End If
Else
strYear = Year(Now())
End If
strDate = grpMonths.Value & "/1/" & strYear
' lines below is my problem
EndDate.SetFocus
EndDate.Text = strDate
End Sub