Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Form with Subform

Status
Not open for further replies.
Jul 9, 2008
17
0
0
US
I have an Access form that contains a combo box. When a selection in the combo is made, the information relating to that selection is displayed in the subform.

Here is the code that I have behind the combo box:

Code:
Private Sub cboTitle_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[m_ID] = " & Str(Nz(Me![cboTitle], 0))
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    myid = Me.ID
    Me.Subform.Requery
End Sub

The problem is that when a selection is made from the combo box, the information in the subform changes fine the first time, but when another selection is made from the combo the information on the subform does not change.

Can anyone shine some light on this for me?
 
Seems like a difficult way to do this. Why not just use the power of a subform. Just set the child master relationship of the subform control

child: m_ID
Parent: [cboTitle]

This assumes that the bound column of cboTitle is the ID
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top