Hey goosehunter
There, there are two ways of doing this. One takes a large swipe at your computer resources by creating a copy of your dataset and generating a clone of the recordset. This is all good and well when you have a small table, but when you have a large amount of data to trawl through, that's when your resources take the hit.
The other way, and it's easier, is to just allow the form to read one row from the database table at a time. By telling the form just which row to view, you get away with as little as you can.
However, there is a catch (Surprise!!) By doing it this way, you must choose a new record implicitly to see new information i.e. You must chose a new company name from your combobox. This is because the record source for your form will just have one record instead of the entire recordset. Just bare that in mind.
So, with that in mind, let's begin.
You need to do two things.
Firstly, you need to create the dropdown list that will have the names of the companies in your database. I assume you already have that.
Next, you want to populate the textboxes below your combo box with the company data for the name in the combo box.
In design mode, right click your combobox, choose Build Event, and choose Code Builder. The Code Window will open. Add the following code:
Private Sub Combo__NumHere_Change()
Dim strCompanyName, strSQL As String
strCompanyName = Me.Combo__NumHere.Value
strSQL = "SELECT * FROM _TABLENAME_ WHERE _TABLENAME_.CompanyName = '" & strCompanyName & "'"
Me.RecordSource = strSQL
Me.Combo__NumHere.Value=""
End Sub
Where it says __NumHere you must add the number of your ComboBox, and where it says __TABLENAME, you add the name of your table where the data sits. Where it says __TABLENAME.CompanyName you add the Field name of you table where the company names are stored.
Try that goosehunter
anvil19