Hi:
From the code you have in the macro procedure, you're still using a subform. You may have good reason to do that, but it's not clear. You're probably on the right track, but without some familiarity with your project, it's not easy to advise.
Access 2000 uses ADO as a default and I'm sure Access 2002 does too. I use DAO a lot, and to do that I've had to move the Microsoft DAO 3.60 Library into the third position in the preferences list you'd find in Tools_Preferences in VBA Help. (Click on Help while in design view, viewing Code.)
In any case try using the wizard to build your combo box. Make sure the wizard icon is on, and drag the combo box icon to your form. The wizard will ask if you want the combo box to find a particular record...click on that choice and the wizard will build the control for you. You can amend or adapt it later.
I use combo boxes all the time to find and select the record of a client, a property, a tenant, a check, or a deposit from thousands of records. Here's a typical procedure for the OnClick event of a combo box:[tt]
Private Sub cboProp_Click()
'Find the record that matches the control.
Dim RS As Object
Set RS = Me.Recordset.Clone
RS.FindFirst "[PropID] = " & Str(Me![cboProp])
End Sub[tt]
You should be able to click on the down arrow on the right side of the combo box, scroll down (or up) the box until you find the record you're looking for, select it, and that record will be displayed.
The wizard will build something similar to the above code, but will add code for error handling, which is good. I have profitably spent some time looking at the code that was built by the wizard...for combo boxes, command buttons, etc.
When I go to Help, "Combo_box", I find an almost overwhelming list of articles, beginning with the most useful, for my purposes.
I've also relied on a couple of manuals,
Access 2000 Bible and
Running Access 2000. A great deal can be learned and copied from the sample database
Northwind that shipped with Access 2000 and earlier versions, and I assume ships with Access 2002. If not, it can be downloaded from Microsoft.
Also, Microsoft has a great resource database you can download, named "frmsmp00" for A2K, and I assume there's one named "frmsmp02" for Access2002. That file has all kinds of good techniques, and it will give you references to articles on Microsoft's knowledge base that go into more detail.
I have a small database that would demonstrate the use of a combo box to select and display a record from a recordset. If you want to give me your email address, I could send it to you.
Let me know.
padregus@attbi.com
![[glasses] [glasses] [glasses]](/data/assets/smilies/glasses.gif)
Gus Brunston, using Access2000
Intermediate skills.