TheKidLarose
Programmer
I have been working at this for a over a week and I am baffled. I need help. I am new at coding so this maybe very basic for others but certainly complicated for me. I am trying to create code to take the information from a text box on a form entered by a user and locate records that match the first string they enter or a name they enter. I then want to transfer the record to the main form called frmGuest so that user can view their information.
The form that I've made up frmSearchGuest is based on a query qrySearchGuest which is made up of 3 fields, LastName, FirstName and ID. This query is based on a table named People. The form frmSearchGuest has a text field named bxSearch, a go button named btnSearch and an update button to update the information queried to a form named frmGuests. It also has 2 fields, LastName and FirstName which shows the name of all my guests
This is the code that I use to locate a record. It works to some extent but does not find the record that the user has specified
Private Sub btnGoSearch_Click()
Dim LN As String,
LN = "LastName Like '" & Me.bxSearch.Value & "*'"
Me.LastName.SetFocus
DoCmd.FindRecord LN, acEntire, False, acSearchAll, True, acCurrent, True
End Sub
Help
Tks
Denis
The form that I've made up frmSearchGuest is based on a query qrySearchGuest which is made up of 3 fields, LastName, FirstName and ID. This query is based on a table named People. The form frmSearchGuest has a text field named bxSearch, a go button named btnSearch and an update button to update the information queried to a form named frmGuests. It also has 2 fields, LastName and FirstName which shows the name of all my guests
This is the code that I use to locate a record. It works to some extent but does not find the record that the user has specified
Private Sub btnGoSearch_Click()
Dim LN As String,
LN = "LastName Like '" & Me.bxSearch.Value & "*'"
Me.LastName.SetFocus
DoCmd.FindRecord LN, acEntire, False, acSearchAll, True, acCurrent, True
End Sub
Help
Tks
Denis