Search criteria

neilmcmor

Registered User.
Local time
Today, 19:59
Joined
Aug 9, 2007
Messages
70
I have a button that when clicked on the form allows the user to type a surname and searc the database. however at present the full surname must be typed correctly. I would like for it to be able to search with only part of the surname being entered. How could I change the following code to support 'Like'?

Function OpenFindBySurnameForm()
On Error GoTo OpenFindBySurnameForm_Err

' Close the form
DoCmd.Close acForm, "PrisonersBySurname"
' re-open the form to allow passing of parameters
DoCmd.OpenForm "PrisonersBySurname", acNormal, "", "", , acNormal


OpenFindBySurnameForm_Exit:
Exit Function

OpenFindBySurnameForm_Err:
MsgBox Error$
Resume OpenFindBySurnameForm_Exit

End Function
 

Users who are viewing this thread

Back
Top Bottom