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
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