I have a continuous form that is open through a pervious form as follows:
What I'm attempting to do is narrow down the search even further once the continuous form is open. To do this I created a list box on the form heading with the following attached to the After Update event of the list box:
For some reason I can't get this to work. Can anyone see where I may be going astray?
Code:
docmd.openform "frmContinuous",,,"[price]=1.00"
What I'm attempting to do is narrow down the search even further once the continuous form is open. To do this I created a list box on the form heading with the following attached to the After Update event of the list box:
Code:
Private Sub lstDesc_AfterUpdate()
Dim strFilter As String
Dim strDescLike As String
Dim strDesc As String
Dim strDescVal As String
Dim varDescItems As Variant
strFilter = Trim(Me.Filter)
If IsNull(strFilter) = False Or strFilter <> "" Then
strFilter = Me.Filter
strDesc = "'*'"
strDescLike = "Like" 'Default Conditional
For Each varDescItems In Me.lstDesc.ItemsSelected
strDescVal = Me.lstDesc.ItemData(varDescItems)
If strDesc = "'*'" Then
strDescLike = "In"
strDesc = "'" & strDescVal & "'"
Else
strDesc = strDesc & ",'" & strDesc & "'"
End If
Next varDescItems
MsgBox strFilter
strFilter = strFilter & " AND ((qrySelAcknowledge.desc " & strDescLike & "(" & strDesc & "))"
Me.FilterOn = True
Me.Requery
Me.Repaint
Me.Refresh
End If
End Sub
For some reason I can't get this to work. Can anyone see where I may be going astray?