Filter sub form with Combo box

D

delgado92651

Straight forward filter with a combo box, the combo has three fields;
ID, Min & Max, how do I know I'm using the correct field to filter by?
I would like to filter by the Min value. Form won't filter at all. I
filering on a currency filter.

Code:
Private Sub cbcAssetRange_AfterUpdate()

Me.Filter = "YTD = " & Me.cbcAssetRange
Me.FilterOn = True

End Sub

I've also tried this, get a error msg "Not bound to form"

Code:
Private Sub cbcAssetRange_AfterUpdate()

'DoCmd.ApplyFilter "SELECT Categories.* FROM Categories WHERE YTD =
Forms!frmMain!cbcAssetRange"
'Me.cbcAssetRange = ""

End Sub

The sub form being filtered, frmCat, and the combo box, cbcAssetRange,
are in the detail section of the main form, frmMain.

Al
 
G

Guest

The bound column of a combobox will be the value that is seen by the
application and your code. So if your bound column points to the Min value,
you should be good to go. If you would like to use the values of other fields
in the Row Source, you can use Me.combobox.Column(0) for example. That would
return whatever is in the first field of the row source. THe column indices
are zero-based. That is to say that the first column is column(0).
 

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

Similar Threads

Filter tabular form by combo box 0
2 Combo Box Filter for a Form 1
Trouble Filtering a Sub Form With Combo Box Options 2
Combo Box Filter 1
filter combo box 3
filter form by table 10
Filter 7
Remove Filter 2

Top