473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Open form and filter by date range

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
1 5350
NeoPa
32,556 Expert Mod 16PB
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

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

Similar topics

6
by: BlackFireNova | last post by:
Using Access 2002 I am writing a report which draws data from several different tables. I can't link all the tables in a query, as some can not be related without truncating the data. I plan...
0
by: Stinky Pete | last post by:
Hi, The db I'm trying to update has a report form from which all other statistical forms and reports are selected/printed by dept, type, cost, number etc. The report form uses a date filter to...
6
by: fonzie | last post by:
Is there any way to include two unbound text boxes (for a start date and end date) to a filter-by-form? The users may want to filter by several different fields and they may want to include a date...
3
by: kmnotes04 | last post by:
Could anyone tell me how to restrict the date range for items that appear on a report? Old items from previous years appear on the report. I was asked to have only this year's items (and beyond)...
3
by: 6afraidbecause789 | last post by:
If able, can someone please help make a Where clause that strings together IDs in a multi-select listbox AND includes a date range. I wasn’t thinking when I used the code below that strings...
12
smithj14
by: smithj14 | last post by:
I have a form to enter start and end dates then select a worker name to filter a report. This all works fine and when the report is open in preview mode it shows the date range in the txtboxes on the...
10
reginaldmerritt
by: reginaldmerritt | last post by:
I'm trying to open a form where the value of a field has a date closest to today but not beyond todays date. I guess i need some sort of MAX function in a where statment maybe???? Any ideas how...
7
by: munkee | last post by:
Hi all, I am using Allen's excellent form filter script to filter the results from a query. I would now like to add some further functionality. How do I go about displaying say the top N costs...
1
by: JpjVB | last post by:
I'm having difficulty filtering a form using a multiselect list box when using some Allen Browne code. I get the error "Syntax Error (missing operator)in query expression '( IN (""Sydney"London)'. -...
0
by: JpjVB | last post by:
Hi, I've developed a form filter that produces a number of hours budgeted by employee/location/practice group/experience level and date available using some Allen Browne code. I have two command...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.