473,387 Members | 1,575 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,387 software developers and data experts.

Access 2003 Date Range

1
Help!
I have a form that contains a From and To - Date Fields and I would like to be able to enter the dates and then click a button labeled 'Display' which will then list records that are between the specified date ranges. The records are to display on a list box. I have found some help in this forum but it all seems to be centered around displaying the results on a report. I need the results on a list box.

I am a newbie to Access and this forum so please be gentle!
Thanks
Dec 29 '06 #1
2 1563
nico5038
3,080 Expert 2GB
In the OnClick of the button fill the listbox rowsource like:

me.listboxname.rowsource = "select a, b from tblZ where dateX between #" & me.txtStartdate & "# and #" & me.txtEnddate & "# "
me.refresh

Getting the idea ?

Nic;o)
Dec 29 '06 #2
NeoPa
32,556 Expert Mod 16PB
There is a slight possibility of date problems with this, otherwise perfect, code.
To avoid any such issue (See Literal DateTimes and Their Delimiters (#).) try this doctored version :
Expand|Select|Wrap|Line Numbers
  1. Me.ListBoxName.RowSource = "SELECT a, b FROM tblZ WHERE dateX Between " & Format(Me.txtStartDate,"\#m/d/yyyy\#") & " And " & Format(Me.txtEndDate,"\#m/d/yyyy\#")
  2. Me.Requery
Dec 30 '06 #3

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

Similar topics

2
by: lpeterson | last post by:
I'm trying to calculate the number of months between dates that begin in 2003 and end in 2004(ex. 1/2/2003 - 7/2/2004). I need the total months in 2003 and in 2004 both of which should add up to...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
0
by: ImraneA | last post by:
Hi there Many thanks to those people who contributed to this group, helped me greatly. Enclose, my code, hope it helps others :- Public Function Export_Excel_9(tbx1 As Variant, tbx2 As...
4
by: JMCN | last post by:
object invalid or no longer set - confusion of the recordset in access 2003. i am currently converting from access 97 to access 2003. majority of the codes converted over perfectly fine, though...
4
by: jwa6 | last post by:
I have a user/pc specific problem in access. This doesn't occur on any other ( windows xp pc) that I have used the ..mbd on. This involves a query that's using a range of dates as a parm. This...
2
by: Jim H | last post by:
I'm trying to get a bunch of records based on client id and a date range. I keep getting an error when I enclose my date string in quotes in the where cleause. The error is: Microsoft JET...
17
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting...
3
by: keithsimpson3973 | last post by:
I am trying to find a way to do the following I need to make a report (or datagrid, not sure which would be better) that can be printed. The format of the report is as follows: The first column...
1
by: heckstein | last post by:
I am running a query in Access 2003 to pull training courses with a start date that falls within a specified date span such 2/1/07 to 2/28/07. I was using this code - (( I.STARTDATE) Between...
2
by: keithsimpson3973 | last post by:
I have a program built in Visual Basic 6. It uses an Access 2003 database. My report selection form in vb6 has 2 date pickers for start date and end date. The report is an Access report. When the...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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.