Microsoft Access dlookup criteria mismatch error

27 views Asked by At

I'm new to access and im creating a search on Microsoft access. It takes the name field has an input to check, then provide a link to a PDF. I've got it working, but I'm trying to add a criteria that allows you to get the input slightly wrong for it to work.for example

"Testing" will work but "Testi" would not.

I get a mismatch error which I can't seem to fix. Any help would be greatly appreciated.

My code is:


    Dim value As String

    Dim textboxValue As String

   

    

    'Gets manual and hyperlinks to website'

    'value = DLookup("[Manual]", "PSearchQ", "[Name]='" & PSearchBox.value & "'") <- working

    value = DLookup("[Manual]", "PSearchQ", "[Name]='" & Like " * " & PSearchBox.value & " & * """)

    Application.FollowHyperlink Address:=value

   

    'Like "*" & [Forms]![frmDashboard]![PSearchBox] & "*"

End Sub

 

Private Sub PSearchBox_AfterUpdate()

    PSearchList.Requery

End Sub

Multiple different ways of putting the " and &, but I don't really understand 100%

0

There are 0 answers