Hi- (Sorry for not using proper naming conventions)
I have a ListBox (List16)
I have a Text Box (Text67)
I have a Command Button (Command71)
The data being looked at is in Table: Company, Field: Company_Name.
My Company Unique ID is called: DUNS_Number
My main form is called: CompanyMain
I would like the user to be able to add something like this to Text67
And then they could click Command71 and List16 would show a list of companies that contained Ash.. such as Ashland Chemicals or Ashley Corporation ect.
I woudn't mind if they could use the * at the beginning either..
Returns: Ashland Chemical or Stashouse Brick
I also have two other ListBoxes (List45 and List53) which would have to be set to null at the end of the process.
I was reading another thread about this but I got myself confused..
I don't even know if this is what I should be using (as I mentioned I got this from another thread) so a complete re-write is fine with me too..
Code is below -
Thanks for any help.
Dim strSQL As String
'Set row source for list box
strSQL = "SELECT Company.DUNS_Number, Company_Company_Name, "
strSQL = strSQL & "WHERE Company_Company_Name like '" & [Forms]![CompanyMain]![Text69] & "*'"
'Update List Box with search results
Me!List16.RowSource = strSQL
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Me.List45 = Null
Me.List53 = Null