G
Guest
Hi all...I am developing this search form where it has txtCassID as unbound
text box and lstResults as list box. On the open event of the form I populate
my list box with a query that has customer name, id, movie, rent date and
cass id. What I would like to do is in a text box end user can type cass id
and as they are typing the focus on list box should be directed towards the
cass id they are typing. I mean having the background color different from
the rest of the records so it can be easily spotted. I am not able to do
this. Below is my code on change event of text box.
Dim strSQL
Dim txtSearching
txtSearching = Me.txtCassID.Text
strSQL = "SELECT tblMovie.Movie_Name AS Movie,
tblRentalTransaction.Movie_CaseID AS [Cas/DVD ID], tblCustomer.Customer_ID &
' ' & [Customer_LastName] & ',' & ' ' & [Customer_FirstName] AS Customer,
tblCustomer.Customer_Phone AS Phone, tblRentalTransaction.Movie_OutDate AS
RentDt, tblRentalTransaction.Movie_ProInDate AS [Expected Return Date]"
strSQL = strSQL & "FROM tblMovie INNER JOIN (tblRentalTransaction INNER
JOIN tblCustomer ON tblRentalTransaction.Customer_ID =
tblCustomer.Customer_ID) ON tblMovie.Movie_SerialNumber =
tblRentalTransaction.Movie_SerialNumber"
strSQL = strSQL & "where tblRentalTransaction.Movie_CaseID Like '" &
txtSearching & "*' "
Me.lstRentalList.RowSource = strSQL
Me.lstRentalList.Requery
text box and lstResults as list box. On the open event of the form I populate
my list box with a query that has customer name, id, movie, rent date and
cass id. What I would like to do is in a text box end user can type cass id
and as they are typing the focus on list box should be directed towards the
cass id they are typing. I mean having the background color different from
the rest of the records so it can be easily spotted. I am not able to do
this. Below is my code on change event of text box.
Dim strSQL
Dim txtSearching
txtSearching = Me.txtCassID.Text
strSQL = "SELECT tblMovie.Movie_Name AS Movie,
tblRentalTransaction.Movie_CaseID AS [Cas/DVD ID], tblCustomer.Customer_ID &
' ' & [Customer_LastName] & ',' & ' ' & [Customer_FirstName] AS Customer,
tblCustomer.Customer_Phone AS Phone, tblRentalTransaction.Movie_OutDate AS
RentDt, tblRentalTransaction.Movie_ProInDate AS [Expected Return Date]"
strSQL = strSQL & "FROM tblMovie INNER JOIN (tblRentalTransaction INNER
JOIN tblCustomer ON tblRentalTransaction.Customer_ID =
tblCustomer.Customer_ID) ON tblMovie.Movie_SerialNumber =
tblRentalTransaction.Movie_SerialNumber"
strSQL = strSQL & "where tblRentalTransaction.Movie_CaseID Like '" &
txtSearching & "*' "
Me.lstRentalList.RowSource = strSQL
Me.lstRentalList.Requery