Question
February 27, 2008 at 07:32 AM
ravingrl

MS Access – Input Box and Wildcards

by ravingrl . Updated 18 years, 5 months ago

I have a simple MS access database that I created to log user information, it is used by several people. I have a switchboard with a button to enter a new issue, which brings up an input box to enter the user’s last name and then brings up the proper record. I would like to be able to enter a wildcard in case there is uncertainty about the spelling of a last name.
Currently the code is:
rivate Sub ViewUserProfiles_Click()
On Error GoTo Err_ViewUserProfiles_Click

Dim stDocName As String
Dim stLinkCriteria As String
Dim strUserInput As String

strUserInput = InputBox(“Enter the employee’s last name or click Cancel to view all records:”, “User Input”)
If Not strUserInput = “” _
Then
stLinkCriteria = “[LastName]='” & strUserInput & “‘”
End If

stDocName = “User Profiles”
DoCmd.openform stDocName, , , stLinkCriteria

Exit_ViewUserProfiles_Click:
Exit Sub

Could someone suggest something to add to create a “wildcard” feature so that putting in the first couple of letters of the last name will bring up pertinent records??
I am not a programmer so please keep it simple if you can.
Thanks for any help.

This discussion is locked

All Comments