Link to home
Start Free TrialLog in
Avatar of João serras-pereira
João serras-pereiraFlag for Portugal

asked on

Invalide use of prprty on

Hi

On my app I need to select a subset of records from which it depends. Sou created a filter field, in the form, and, on mouse up I pretend to filter and refres

But I am consistently getting an error wen I put Me. filter On (or with the extended syntax...)

my code is:


Private Sub fld_locateUser_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)


   
    Dim strUserID As String, _
        strUserTipo As String
        
        

'Me.Filter = "[LastName] Like '*" & [ControlName] & "*'"
'Me.FilterOn = True


On Error GoTo errorTrap
    
    Call logMe("fld_locateUser_MouseUp frm_selecaoPatrons", "start")
    Forms!frm_selecaoPatrons.Filter = "[cellphone] Like '*" & [fld_locateUser] & "*' or [full_name] Like '*" & [fld_locateUser] & "*'"
    Forms!frm_selecaoPatrons.FilterOn
    Forms!frm_selecaoPatrons.Requery
    Forms!frm_selecaoPatrons.Repaint

    Call logMe("Form_Close frm_selecaoPatrons", "end")
    Exit Sub
    
errorTrap:
    If Err.Number <> 2501 Then
        MsgBox "[Form_Close frm_selecaoPatrons errorTrap]." & _
                "[" & Err.Number & "].[" & Err.Description & "]"
        Call logMe("frm_selecaoPatrons errortrap", _
                    "[Form_Close frm_gestaoPatrons]." & "[" & _
                    Err.Number & "].[" & Err.Description & "]")
    End If
    Resume Next
    

End Sub

Private Sub Form_Close()

   
    Dim strUserID As String, _
        strUserTipo As String

On Error GoTo errorTrap
    
    Call logMe("Form_Close frm_selecaoPatrons", "start")
    DoCmd.OpenForm "frm_enviarUnicoSMS"
    Call logMe("Form_Close frm_gestaoPatrons", "end")
    Exit Sub
    
errorTrap:
    If Err.Number <> 2501 Then
        MsgBox "[Form_Close frm_selecaoPatrons errorTrap]." & _
                "[" & Err.Number & "].[" & Err.Description & "]"
        Call logMe("frm_gestaoPatrons errortrap", _
                    "[Form_Close frm_selecaoPatrons]." & "[" & _
                    Err.Number & "].[" & Err.Description & "]")
    End If
    Resume Next
    
End Sub

Open in new window


User generated image
can anyone help?
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial