Ugh. Almost complete with combo/subform

  • Thread starter Thread starter Andrew Tatum
  • Start date Start date
A

Andrew Tatum

I have a a combo box and a sub form. When someone makes a selection in
the combo box, I'd like it to pull the changes for the subform.

Here are the details:

In CompanyCombo I have the following for RowSource:

SELECT [Just Companies].CompanyID, [Just Companies].Name
FROM [Just Companies];

I then have the following event procedures:

Private Sub CompanyCombo_Change()

End Sub

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[CompanyID]"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub CompanyCombo_KeyPress(KeyAscii As Integer)

End Sub

The subform is: Messages Subform

They are linked through CompanyID.

If anyone has any ideas I would really, really appreciate it!
 
Your FindFirst method needs a full criteria expression. Try changing it to:

rs.FindFirst "[CompanyID] = " & Me.CompanyCombo

HTH,
Barry
 
Back
Top