using combo box to go to record in subform

fixious

New member
Local time
Today, 09:49
Joined
Apr 30, 2002
Messages
9
I have a combo box with 2 fields showing Inmate Name and Kit Number. What I want is when I click on the Inmate name it will go to that record in the subform. How do I do this? Thank you.
 
I would suggest another field in the combo box using the InmateID rather than the name. If is very possible to have two Robert Smiths....

If you have an InmateID in the subform and in the Combo box then in the Master/Child links select InmateID for the Child link and the Combobox name for the Master link. Be sure the InmateID is the bound column in the Combo box....

hth,
Jack
 
The table for my subform doesn't show up when I need to put in a control source for the combo box. Is this a relationship thing? I don't know understand how to make this happen. Thank you for your comments.
 
I assume you have two tables, one is Inmate information and the second table has details about the inmate. Something on the order of Customers and Orders where One Customer can have Many orders. In your case it would be One Inmate and Many 'somethings' (I don't know what it coud be). Here is how your tables might look:

tblInmateInformation
InmateID (Primary Key and Autonumber)
LastName
FirstName
MiddleInitial
...other fields

tblInmateDetails
DetailsID (Primary Key and Autonumber)
InmateID (Foreign Key and Long Integer)
...Whatever fields you need

The above would be an instance where you would have a Main Form (InmateInformation) and a Subform (InmateDetails)

If this is the setup you have then your tables will be joined on InmateID (in the relationships window) and in your main form the combo box will be based on the InmateID, LastName and FirstName. Therefore the Master Link in your Subform would be the Combo box and the Child Link would be the InmateID.

I hope this makes sense to you. If you do not have a setup like this then a subform is probably not appropriate for what you want to do.

hth,
Jack
 

Users who are viewing this thread

Back
Top Bottom