Ugh. Almost complete with combo/subform

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!
 
B

Barry Gilbert

Your FindFirst method needs a full criteria expression. Try changing it to:

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

HTH,
Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top