I have a form called Sites, based on a table named Sites, which is filtered to show results for just one Site. The code used for the filter is:
In another table (called Log of Checks) there are lots of records each of which is attributed to a Site, and each has a Status of "Pend" or "Comp". On my Sites form I want to add a field showing a count of the records in this Log of Checks table with the status of "Pend" but only for the filtered Site.
I've addded a textbox to my Sites form with the following code and nothing is happening:
Can anyone help? I'm quite new to Access and have been working on this for a week now.
Code:
Private Sub Compfilter_AfterUpdate()
If IsNull(Me.Compfilter) Then
Me.FilterOn = False
Else
Me.Filter = "[Sites.Site] = """ & Me.Compfilter & """"
Me.FilterOn = True
End If
End Sub
I've addded a textbox to my Sites form with the following code and nothing is happening:
Code:
=DCount("*","log of checks","[Status]='Pend' AND [Site] = '[Forms]![Sites]![Compfilter]'")
Comment