Search combo boxes

S

str8trini

I am trying to use a form as a search form and to update records based on two
combo boxes but I am running into issues. Using help on other posts here, I
was able to get the combo boxes to work, or so I thought. The initial entry
gives me the correct results but then I can page down and scroll through all
the records in the form's record source.

This is the code I have used on the Update event of the second combo box:

Private Sub cboBLNum_AfterUpdate()
With Me.RecordsetClone
.FindFirst "[LoadNum] = " & Me!cboLoadNum & _
" AND [BL_Num] = " & Me!cboBLNum
Me.Bookmark = .Bookmark
End With
End Sub

As I scroll, cboBLNum changes but cboLoadNum does not. I think that is
based on the code in my On Current event below:

Private Sub Form_Current()
If Me![txtBL] > 0 Then 'txtBL is a hidden field on my form
Me!cboBLNum = Me!txtBL
End If
End Sub

As values are duplicated in both these fields it is a combination of these
fields that makes it a unique record. So, I want to limit the results in both
my main form and subform to only the records equal to the the combination of
entries in the combo boxes and not just one. If I can scroll throught the
records I want both boxes updated to reflect the values of the individual
record. Please let me know if you need any further clarification and thank
you in advance for the assistance.
 

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