And once you move away from recordset-oriented thinking from Access-oriented, it becomes
Private Sub cboCompany1_AfterUpdate()
ServerFilter = "id=" & cboCompany1
Requery
End Sub
Main Topics
Browse All TopicsI am simply trying to have a the result selected from a Combo box post to this form. I had it working in an mdb (see mdb code ) and tried to translate it to ADO (see adp code) however it is not quite right.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
(since I'm now working with very similar design)
actually, the best solution, it appears, is to have unbound main form, and accordingly unbound field (combobox or textbox) where the user is making the entry to search for; the found data is displayed in the subform by means of the usual master field/child field; in this case, no code is required at all.
If search field is bound, it becomes hard to prevent changing the existing record to the entered value, instead of navigating to it - too many various scenarios.
Business Accounts
Answer for Membership
by: LPurvisPosted on 2009-09-26 at 04:44:02ID: 25429550
Hi
In what way doesn't it work? i.e. What error if there's an error or what behaviour is manifested?
The code you're using isn't exactly the wizard generated code in an ADP.
The most crucial difference is that you're refering to the form's Recordset property. You're not creating a clone or working with the form's own clone.
What you would normally have instead would be
Private Sub cboCompany1_AfterUpdate() im rs As Object
D
Set rs = Me.Recordset.Close '<<<<< ---- This line here
rs.Find "[ID] = " & Str(Nz(Me![cboCompany1], 0))
If rs.EOF Then Exit Sub
Me.Bookmark = rs.Bookmark
End Sub
This makes it a bit closer to the MDB created equivalent.
The reason for this is that a new Clone (which is what's created by the .Clone method) will be distinct from the form's own recordset. It will be position on the first row and the Find method will search from there. (The default should be the Current Row - but in a form's own recordset - you may or may not see consistent behaviour). The MoveFirst should guarantee that you code worked - when you're working with the form's recordset as you are then the Bookmark line is unnecessary.
i.e. this should still have worked for you
Private Sub cboCompany1_AfterUpdate() im rs As Object
D
Set rs = Me.Recordset
rs.MoveFirst
rs.Find "[ID] = " & Str(Nz(Me![cboCompany1], 0))
End Sub
or even
Private Sub cboCompany1_AfterUpdate()
Me.Recordset.Find "[ID] = " & Str(Nz(Me![cboCompany1], 0)), 0, adSearchForward, adBookmarkFirst
End Sub
The rest of the code is wizard standard, including the presupposition that "0" isn't a viable value in your records selection. (It's an Autonumber/Identity assumption that you'll have started from 1 and are unlikely to have come back to 0!)
If something specific is wrong then certainly spell it out.
Cheers.