G
gjameson via AccessMonster.com
I have 3 text boxes that I want to be able to use for searching.
srcID
scrCustomer
srcAddress
I have a list box below these text boxes that I want to dynamically update as
the user types in the text boxes. I thought I had this worked out early but I
have sleep since then.
Here is my sql for my list box.
SELECT DISTINCTROW Customer.ID AS ID, Customer.[Cust Name] AS Customer, [St
Nbr] & " " & [St Name] AS Address, Customer.MODEM_PHNE AS [Modem #], Customer.
IT_CUST AS IT, Customer.EVC_BRAND AS EVC, Customer.CHT_BRAND AS Chart,
Customer.[Mtr Size] AS [Mtr Size], Customer.[Mtr #] AS [Mtr #], Customer.
[Prem #] AS [Prem Code]
FROM Customer
WHERE (((Customer.ID) Like [Forms]![Main]![srcID] & "*"))
OR (((Customer.[Cust Name]) Like [Forms]![Main]![scrCustomer] & " *"))
OR ((([St Nbr] & " " & [St Name]) Like [Forms]![Main]![srcAddress] & "*"))
ORDER BY Customer.ID, Customer.[Cust Name];
Here is my vb for the form
Private Sub srcID_Change()
On Error GoTo Err_srcID_Change
Me.Refresh
Me.srcID.SelStart = Len(Me.srcID)
Err_srcID_Change:
Exit Sub
End Sub
Private Sub srcAddress_Change()
On Error GoTo Err_srcAddress_Change
Me.Refresh
Me.srcAddress.SelStart = Len(Me.srcAddress)
Err_srcAddress_Change:
Exit Sub
End Sub
Private Sub scrCustomer_Change()
On Error GoTo Err_scrCustomer_Change
Me.Refresh
Me.scrCustomer.SelStart = Len(Me.scrCustomer)
Err_scrCustomer_Change:
Exit Sub
End Sub
I can get this to work when I only use one textbox in my query. What am I
missing here?
TIA
Gerald
srcID
scrCustomer
srcAddress
I have a list box below these text boxes that I want to dynamically update as
the user types in the text boxes. I thought I had this worked out early but I
have sleep since then.
Here is my sql for my list box.
SELECT DISTINCTROW Customer.ID AS ID, Customer.[Cust Name] AS Customer, [St
Nbr] & " " & [St Name] AS Address, Customer.MODEM_PHNE AS [Modem #], Customer.
IT_CUST AS IT, Customer.EVC_BRAND AS EVC, Customer.CHT_BRAND AS Chart,
Customer.[Mtr Size] AS [Mtr Size], Customer.[Mtr #] AS [Mtr #], Customer.
[Prem #] AS [Prem Code]
FROM Customer
WHERE (((Customer.ID) Like [Forms]![Main]![srcID] & "*"))
OR (((Customer.[Cust Name]) Like [Forms]![Main]![scrCustomer] & " *"))
OR ((([St Nbr] & " " & [St Name]) Like [Forms]![Main]![srcAddress] & "*"))
ORDER BY Customer.ID, Customer.[Cust Name];
Here is my vb for the form
Private Sub srcID_Change()
On Error GoTo Err_srcID_Change
Me.Refresh
Me.srcID.SelStart = Len(Me.srcID)
Err_srcID_Change:
Exit Sub
End Sub
Private Sub srcAddress_Change()
On Error GoTo Err_srcAddress_Change
Me.Refresh
Me.srcAddress.SelStart = Len(Me.srcAddress)
Err_srcAddress_Change:
Exit Sub
End Sub
Private Sub scrCustomer_Change()
On Error GoTo Err_scrCustomer_Change
Me.Refresh
Me.scrCustomer.SelStart = Len(Me.scrCustomer)
Err_scrCustomer_Change:
Exit Sub
End Sub
I can get this to work when I only use one textbox in my query. What am I
missing here?
TIA
Gerald