mrmozambique
Registered User.
- Local time
- Tomorrow, 03:57
- Joined
- May 20, 2009
- Messages
- 16
Hi all. I struggle with this every time I try to do it and it seems that I can never find the solution online. I have an unbound combo in the header of a continuous form with a list of districts (text). I want to filter the form based on the text field [DistrictName]. I have the following code in the AfterUpdate on the district combo. Changing the form doesn't filter at all in some, returns zero in another, or asks for the value in the third. What am I doing wrong here?
Code:
Dim strDist As String 'The criteria string.
Dim strDistName
If Not IsNull(Me.cbDistrictFilter) Then
'WHICH OF THESE OPTIONS CORRECT OR ARE ANY CORRECT?
' strDist = "([DistrictName] = " & Me.cbDistrictFilter & ") "
' strDist = strDist & "([DistrictName] = " & Me.cbDistrictFilter & ") "
' strDist = strDist & "[DistrictName] = " & Me.cbDistrictFilter
' strDist = strDist & "[DistrictName] = Me.cbDistrictFilter"
End If