Jumat, 29 November 2013

[MS_AccessPros] Formating question

 

Hello again…..

I’m now trying to “teach” myself some formatting on a report.

The previous creator of the report used a mix of vba and conditional formatting in the report.

Short version:

From the database, we have a project code, a site visit date and a site visit occured checkbox

Using conditional formatting:

1)      If the checkbox is checked, then the date is underlined.

2)      If the date is yet to occur, no formatting.

3)      If the date is past the current date, then the date is bold.

In vba I have the bold part working, but the underline is not working.  The current search query returns 2 records.

What is happening is:

1)      When record #1 is checked, both cells are underlined

2)      When only record #2 is checked, no underlining at all

3)      When both records are checked, both cells are underlined

Trying to figure out why record #2 won’t underline when it is the only one checked?

This is what I have so far –

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

Dim Flag As Integer

Dim k As Date


'Set Occured or Past Status

g = Code   ‘project code for test tracking

Flag = Site_Visit_Occured

If Me.Site_Visit_Occured Then

    Me.[_Site Visit].FontUnderline = True

Else

    If Me.[_Site Visit] <> "N/A" Then

        k = Me.[_Site Visit]

        If k < Date Then

            Me.[_Site Visit].FontBold = True

        Else

            Me.[_Site Visit].FontUnderline = False

            Me.[_Site Visit].FontBold = False

        End If

    End If

End If


End Sub

Thanks

B

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar