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

Open form and filter by date range

P: 1
I'm building a database and am having troubles opening a form with a filter.

I've tried a few things but nothing seems to be doing what I want.

Here's a stop gap solution that at least displays records but with the annoying popup:

Expand|Select|Wrap|Line Numbers
  1. Dim stDocName As String
  2. Dim stLinkCriteria As String
  3.  
  4. StDocName = "HHI Register"
  5.  
  6. StLinkCriteria = "[Media Date Range Start] = [Enter Date ie 09-Nov-11]"
  7. DoCmd.OpenForm stDocName,,,stLinkCriteria
  8. DoCmd.Close acForm, "Front Page"

This is only giving me a result for a single date of course.

What I want is to return a date range from the table "HHI Register" by using 2 text boxes with calender called "TxtDateStart" and "TxtDateEnd"

I tried:

Expand|Select|Wrap|Line Numbers
  1. stLinkCriteria between #" & Format(Me.TxtDateStart, "dd-mmm-yy") & "# AND #" & Format(Me.TxtDateEnd, "dd-mmm-yy") & "#"
No Luck.

Any one want to put me back on the straight and narrow.

Guy
Nov 30 '11 #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,494
Try for line #6 something like :
Expand|Select|Wrap|Line Numbers
  1. StLinkCriteria = "[Media Date Range Start] Between [Enter StartDate] And [Enter EndDate]"
Nov 30 '11 #2

Post your reply

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