Need help coding nested/dynamic combo boxes

Joined
Feb 17, 2009
Messages
1
Reaction score
0
I have a form with 2 combo boxes.

First combobox is VenQuickFind
Rowsource the query below

SELECT qSupplierNameID.ID, qSupplierNameID.Name_1 FROM qSupplierNameID ORDER BY [Name_1];

this the name and index ID of the supplier.

After Update event is the follwing:

Private Sub VenQuickFind_AfterUpdate()
Dim rst As DAO.Recordset
Dim StrSearchname As String

Set rst = Me.RecordsetClone
StrSearchname = Str(Me!VenQuickFind)
rst.FindFirst "ID = " & StrSearchname
Me.Bookmark = rst.Bookmark
Forms!F_VRS!POQuickFind.SetFocus
Me.POQuickFind.Requery
Me.POQuickFind.Value = Me!POQuickFind.ItemData(0)

End Sub



Second Combobox is POQuickfind
Rowsource is:

SELECT qPOQuickFind.PO_Number, qPOQuickFind.ID FROM qPOQuickFind;

here is were I am stuck. VenQuickfind correctly pulls the Purchase Order numbers and populates POQuickfind combo box. I have a subform that lists all the purchase orders and I want to filter only by the PO Number that is selected in the second combo box. I have tried the following but I think my syntax is wrong:

Private Sub POQuickFind_AfterUpdate()
Dim POCombo As String
POCombo = "PO_NUMBER =" & Me.POQuickFind & ""
Forms!F_VRS!subfrmIncomingMerge!PO_Number.SetFocus
DoCmd.ApplyFilter , POCombo

End Sub

I am sure there is a better way to do this but I have not learned enough VB yet.
Any help here?
 

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