I'm trying to use a filter in vba like this:
Private Sub Form_Load()
Me.Filter = "[Alvo] = " & AlvoAtual
Me.FilterOn = True
Me.Requery
End Sub
Where AlvoAtual is global variable, but nothin happens. When I change the AlvoAtual for a specifc value nothin happens too. Like this:
Private Sub Form_Load()
Me.Filter = "[Alvo] = 'AAAA'"
Me.FilterOn = True
Me.Requery
End Sub
Someone knows the problem?
I am adopting this question (VBAWhatnow) in the hope of it getting answered rather than make a duplicate as I was advised.
I am trying to do the same thing except with local variables.
My filter works correctly when I manually define the values but when I introduce the variables the filter no longer works
Forms![frmPendingActions]![qryPendingAction subform].Form.Filter = "Filterby = FilterCrit"
Could anyone help me find a good solution?
Me.Filter = "[Alvo] = " & AlvoAtual
,Me.FilterOn = True
andMe.Requery
need to be on separate lines – user69820