Populating a Form/Subform with a Combo Box

rmead

Registered User.
Local time
Today, 13:28
Joined
Apr 17, 2007
Messages
15
Hi all - interesting situation that I encountered in one of my databases.

The idea of using a combo box to populate a form is fairly simple - select an item from the combo box and all the corresponding information from the tables is populated in the form - simple.

I have a form that is used for data input and data editing, it is exactly the same form for each function except that depending on how you open it, a show/hide macro displays a different combo box.

When the form is opened with method a), that is the first combo box is shown, everything works fine - the header information and the subform update on selection to reflect the appropriate information.

However, when the form is opened with method b), that is the first combo box is hidden and the second combo box is shown, the header information updates fine but the subform will not update. The code behind each combo box is as follows:

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[IR] = " & Str(Nz(Me![IR], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

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

Set rs = Me.Recordset.Clone
rs.FindFirst "[IR] = " & Str(Nz(Me![IR_Revisions], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub


[IR] is the combo box that works, [IR_Revisions] is the one where the subform doesn't update. Any help or thoughts would be appreciated.

-Robert
 
Bump because I still can't fix it...


I have learned that if I delete either combo box from the form entirely, the one that remains works perfectly. Is there some sort of conflict having two different combo boxes driving the same form? I feel like I have other situations that are almost identical with no issues. :(
 
This is essentially the same problem as Im having. Trying to populate one subform using information from to seperate fields. I have found the same problem also when I take one field out of the problem it works fine but when using two it doesnt work what so ever.
Lets have some help on this subject please!

Phill
 

Users who are viewing this thread

Back
Top Bottom