Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help With RowSource Like"*" Clause 1

Status
Not open for further replies.

skkorrp

Programmer
Mar 2, 2001
2
US
I have a lisbox with the rowSource set to : SELECT [Personal].ID, [Personal].Contact
FROM [Personal]
WHERE ((([Personal].Contact) Like "A" & "*"))
This returns all the A's in my Table. I need to refine my search with a textbox[Text2] where i can search my records by data i input in the text box!! For example if I Type "Ar": I would like to see only those records starting with "Ar".
I've tried : Like "'*" & [Forms]![ form name here]![control name here] & "*'" With no Luck!!
Could use some help ...Rodney
 
Have you tried adding code to the textbox's AfterUpdate event? You could dynamically change the RowSource of your listbox there and then requery it. Haven't tried it, but it ought to work...

-Rob
 
Like Rob suggested, add this code to the AfterUpdate event of the textbox:
Code:
Me.List1.RowSource = "SELECT Field1, Field2 FROM KFC00 WHERE Field2 Like '" & Me.YourTextBox & "*';"
 
ummm.... and make that KFC00 be your table name. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top