Seleting the mainform record from a subform

honeyshape

New member
Local time
Today, 13:53
Joined
Nov 20, 2008
Messages
9
I have a form with 2 subforms in it. The first subform is from a linked table that has details about the record selected in the main form. The second subform is a list of all records in the mainform. (it is the same table as the main form). I am using this like a phone directory selector. I want to beable to click the record from the list in the subfrom and have that select that same record in the mainform. Can anyone help?

formlist.jpg

FormWindow.jpg
 
Personally speaking I would change your form so that the description on the main form is a combo box which selects the product and get rid of the second subform. Other than that use a list box in much the same way as your second subform.

David
 
Thanks for your help and advice, I've now created a list box instead of a subform.

so what now? I have tried this, is this right? (i know its not cause it doesnt work)

Private Sub List8_GotFocus()

Me.RecordsetClone.FindFirst "[ComponentID] = & Me![List8]
Me.Bookmark = Me.RecordsetClone.Bookmark

End Sub


ComponentID is the primary key column. List8 is the list box. The main form is called frmComponentLibrary.
 
Don't exactly know what you want to do but you need to place your command on the OnClick event of the listbox.

David
 
sorry for my bad explanation.

Basically I've got a list box in the main form. When I click the item in the list box, I want to select that record in the main form.

Main form is called frmComponentLibrary
The list box is called List8
 

Users who are viewing this thread

Back
Top Bottom