Filtering Subform using option buttons on main form

K

Kevin

I trying the set up a filter option for my database. Long story short
i have a subform in a tab control on the main form. then on the main
form i have a option box with radio buttons with the following
choices, Filter by date, Filter by Account, None and others may be
added later. How do go about setting it up to where i can either
enter dates and have the subform in the tab control display the
correct conditions. and then after the filter click the none radio
button to clear the filter. I have read numerous posts and tried many
things in VBA and i am not sure where to go from here.

Any help would be much appreciated.
Thanks,
 
K

Kevin

I trying the set up a filter option for my database.  Long story short
i have a subform in a tab control on the main form.  then on the main
form i have a option box with radio buttons with the following
choices, Filter by date, Filter by Account, None and others may be
added later.  How do go about setting it up to where i can either
enter dates and have the subform in the tab control display the
correct conditions.  and then after the filter click the none radio
button to clear the filter.  I have read numerous posts and tried many
things in VBA and i am not sure where to go from here.

Any help would be much appreciated.
Thanks,

*****ADDITION*****
I would also like the option to sort by both Date and account
together. Again, thank you for your time!
 
K

Kevin

Something like this;http://www.mvps.org/access/forms/frm0023.htm

just add the sorting with the filter when you build it.- Hide quoted text-

- Show quoted text -

Ok, so I added that and now i get a runtime 438 error.
I am really not sure what any of that string really means. I am new
to VBA in access so please bare with me. here is what i have:

Private Sub Option27_GotFocus()

Me.filterbegin.Visible = True
Me.filterend.Visible = True
strSQL = "Select * from sometable where"
******strSQL = strSQL & " someID=" & Me!Transactions
Me![Transactions subform].Form.RecordSource = strSQL

End Sub

Currently the line beginning with the asterics is the one giving me
the error. I am not sure if i am missing something else. I didnt
think i would have this many issues with this. Again thanks for the
help.
 

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