ник: Lukas
Там нет проверки на годы.
Правильнее будет так как-то:
Private Function fun1() As String
Const FORM_NAME As String = "F_1"
Const TEXT1 As String = " в этом году пункт 'Б' не посещал"
Dim str1 As String
Dim bln As Boolean
If CurrentProject.AllForms(FORM_NAME).IsLoaded Then
With Forms(FORM_NAME)
bln = IsNull(.Controls("fld_Date"))
If Not bln Then bln = bln Or Year(.Controls("fld_Date")) < Year(Date)
If bln Then
If .Controls("cbo_Sex") = "Жен." Then
str1 = TEXT1 & "а"
Else
str1 = TEXT1
End If
Else
str1 = Format$(.Controls("fld_Date"), "dd mmmm yyyy")
End If
End With
End If
fun1 = str1
End Function
|