هذا ما كنت اريده بالظبط و الحمد لله وصلت الية بفضلك استاذي jjafferr و الحمد لله
Public Function FirstDate()
Dim year1 As Integer
Dim month1 As Integer
Dim day1 As Integer
Dim myday As Integer
Dim myDate As Date
year1 = Year(Date)
month1 = Month(Date)
day1 = Day(Date)
myday = DLookup("[dayfirst]", "[firstd]")
myDate = DateSerial(year1, month1, 0)
If day1 >= myday Then
myDate = DateSerial(year1, month1, myday)
Else
myDate = DateSerial(year1, month1 - 1, myday)
End If
FirstDate = myDate
End Function