473,324 Members | 2,356 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,324 software developers and data experts.

Creating form to select records between two dates

1
Hi There,

I am quite new to Access 2003 and am looking for someone to help me with a project im starting on.

I currently have a query that is run which will pull up records on selected data and in the design view I put dates between two dates in the criteria.

I want to create a form that will be the front end where a week beginning date and week ending date can be entered - and this will then be able to run the query with these dates in the front end form as the criteria for the records to pull up.

Does this involve me having to write som VB with the the existing standard code for the run query button:
Expand|Select|Wrap|Line Numbers
  1. Private Sub RunRTTCof_Click()
  2. On Error GoTo Err_RunRTTCof_Click
  3.  
  4.     Dim stDocName As String
  5.  
  6.     stDocName = "All_Outpat_Week"
  7.     DoCmd.OpenQuery stDocName, acNormal, acEdit
  8.  
  9. Exit_RunRTTCof_Click:
  10.     Exit Sub
  11.  
  12. Err_RunRTTCof_Click:
  13.     MsgBox Err.Description
  14.     Resume Exit_RunRTTCof_Click
  15.  
  16. End Sub
thnaks
Mar 10 '09 #1
1 5368
NeoPa
32,556 Expert Mod 16PB
No. Just refer to the controls on the form within the query.
Expand|Select|Wrap|Line Numbers
  1. ...
  2. WHERE DateField Between [Forms]![YourFormName].[FromDate] And [Forms]![YourFormName].[ToDate]
Apr 4 '09 #2

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

Similar topics

2
by: Iain Miller | last post by:
Now this shouldn't be hard but I've been struggling on the best way as to how to do this one for a day or 3 so I thought I'd ask the assembled company..... I'm writing an application that tracks...
8
by: Mark | last post by:
When my form goes to a new record, I have a procedure that copies the last record added to the form's underlying table into the form. The intent is that a series of new records may have the same...
1
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access...
5
by: John | last post by:
I have 2 tables, one with dates and information about those dates, and one with people information. I want to create a report listing each date and the people who attended on that date (who have...
3
by: rreitsma | last post by:
I want to create a form that will allow the user to select from a list of available reports and based on a filter limit the records displayed in the report. I have figured out how to access the...
5
by: Henning M | last post by:
Hi all, I having some problems with Access and selecting records between dates.. When I try this in access, it works fine!! "Select * from Bilag Where Mdates Between #1/1/2006# And...
7
by: rcamarda | last post by:
I wish to build a table based on values from another table. I need to populate a table between two dates from another table. Using the START_DT and END_DT, create records between those dates. I...
2
by: Mark Roughton | last post by:
I have a form where the users need to view records for various criteria, one of which is a date field on which they may wish to view all related data for the selected date, for all dates upto and...
5
by: keri | last post by:
Hi, I have a table with 2 fields - flddate and category. The values of flddate are all working day dates (monday to friday dates between jan 2007 and 2010 (although the end date could change)....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.