subform in a tabbed form won't search

K

kathrynwoning

I have a subfom w/ a combo box that searches a list of architects then fills
contact information in text boxes on the form. When I place this in a tabbed
form it does not function correctly. The combo box lists the architects, but
the selected architect's information does not fill the text boxes. Can anyone
tell me what variable I am missing that causes (or allows) this malfunction?
 
K

kathrynwoning

on the combo box after update:

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[archID] = " & Str(Nz(Me![Combo16], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
'Me.archID = Forms![frmBidsTabs]![bidArchitect]
End Sub
 
M

Marshall Barton

kathrynwoning said:
on the combo box after update:

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[archID] = " & Str(Nz(Me![Combo16], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
'Me.archID = Forms![frmBidsTabs]![bidArchitect]
End Sub


I don't think that code can ever work, regardless of
main/sun form or tab. Try something more like:

Private Sub Combo16_AfterUpdate()
' Find the record that matches the control.
With Me.RecordsetClone
.FindFirst "[archID] = " & Nz(Me![Combo16], 0)
If Not .MoMatch Then Me.Bookmark = .Bookmark
End With
End Sub
 
K

kathrynwoning via AccessMonster.com

That works in the subform as well, but not in the tabbed form. The address
boxes still do not fill with the selected architect.
 
M

Marshall Barton

kathrynwoning said:
That works in the subform as well, but not in the tabbed form. The address
boxes still do not fill with the selected architect.


A tab control has nothing to do with this kind of thing so I
guess we need more specific information about how your
form(s?) and combo box are arranged. E.g. did you move the
combo box to the main form or is it still in the subform?
 
K

kathrynwoning via AccessMonster.com

No, it is still in the subform. Shall I move it?

Marshall said:
A tab control has nothing to do with this kind of thing so I
guess we need more specific information about how your
form(s?) and combo box are arranged. E.g. did you move the
combo box to the main form or is it still in the subform?
 
K

kathrynwoning via AccessMonster.com

I believe I can copy it all from the subform to the main form and make it
work... I don't know what the disadvantages of that are, however.
No, it is still in the subform. Shall I move it?
[quoted text clipped - 3 lines]
form(s?) and combo box are arranged. E.g. did you move the
combo box to the main form or is it still in the subform?
 

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

Top