By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

Filtering a Subform

P: 49
Hi
I have a main form with a subform. The mainform has 2 textboxs Starting date and ending date. These are for the user to select a date range, and then clicka button to filter the subform to view only records that are in the date range. This DB is in Access 2007. I have tried appling filter with a saved query I have also tried the folloing code. Any ideas
Thanks
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command111_Click()
  2. Me!tbl_leasefllwup.Filter = "fllupdate = between me!start and me!end"
  3. Me!tbl_leasefllwup.FilterOn = True
  4. End Sub
Aug 19 '08 #1
Share this Question
Share on Google+
3 Replies


rsmccli
P: 52
Try something more like:
Expand|Select|Wrap|Line Numbers
  1. Me.Filter = "[fllupdate] Between #" & Me.Start & "# And #" & Me.End & "#"

Good luck with your problem,
rsmccli
Aug 19 '08 #2

NeoPa
Expert Mod 15k+
P: 31,661
Good advice, but the date values also aught to be formatted. See Literal DateTimes and Their Delimiters (#).
Aug 20 '08 #3

P: 49
Good advice, but the date values also aught to be formatted. See Literal DateTimes and Their Delimiters (#).
Thanks
Works Perfect.
Aug 20 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.