• Date problem??

    Author
    Topic
    #355086

    I have some code in a birthday report that I would like it to highlight and put a star beside everyone whose birthday is in the current month. So far this is what I have:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

    Dim MyDate, MyMonth, MyMonth2, MyDate2
    MyDate = [BirthDate+]
    MyMonth = Month(MyDate)
    MyDate2 = Date
    MyMonth2 = Month(MyDate2)
    If MyMonth2 = MyMonth Then
    Me![BirthDate+].FontBold = True
    Me![BirthDate+].FontName = “Arial Black”
    Me![BirthDate+].FontSize = 12
    Me![BirthDate+].ForeColor = vbRed
    Me![BirthDate+].BackColor = vbYellow
    Me![imggoldstar].Visible = True
    Else
    Me![BirthDate+].FontBold = False
    Me![BirthDate+].FontName = “Arial”
    Me![BirthDate+].FontSize = 9
    Me![BirthDate+].ForeColor = vbBlack
    Me![BirthDate+].BackColor = vbWhite
    Me![imggoldstar].Visible = False
    End If

    End Sub

    It is not working. The birthdays that it is highlighting are 01 and 08 for the month. The current month is 04. Can anyone suggest a way to do this?

    Viewing 3 reply threads
    Author
    Replies
    Viewing 3 reply threads
    Reply To: Date problem??

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: