Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Entering Dates

Author  Topic 

msugradus
Starting Member

40 Posts

Posted - 2007-06-27 : 11:56:24
I am using Access with a SQL server database. I currently have a switchboard to display different reports and when the end user clicks on a report they get prompted to enter starting and ending dates.

ALTER PROCEDURE dbo.sp_MTD_Cancels

(@prevMonthStart datetime, @prevMonthEnd datetime, @thisMonthStart datetime, @thisMonthEnd datetime)
as

I was wondering if there was a way to allow the end user to pick from a range of dates when they hit the report button instead of having to manually enter them?

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-06-27 : 13:51:54
A simple google search found this page right away that has lots of options:

http://www.granite.ab.ca/access/calendars.htm


- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

msugradus
Starting Member

40 Posts

Posted - 2007-06-28 : 09:34:35
That option is not applicable in this situation. When the end user clicks on a report button on the switchboard it prompts them to enter and start and end date for one month or two months depending on the report. After entering the second date the report is generated. I need to do this same thing but offer a list of months instead of having to manually enter the dates.
Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2007-06-28 : 10:38:42
You can use a combo box on an unassigned field. Then reference that field on your reports “input parameters” Value. Of course this will only pass one variable so you will need two fields or calendars for start and end date.

Jim
Users <> Logic
Go to Top of Page

msugradus
Starting Member

40 Posts

Posted - 2007-06-28 : 11:29:03
I kind of get what you are saying but I can't seem to get it straight in my head exactly how it would work and where to code it...
Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2007-06-28 : 13:51:10
Your Querry/sp needs two Input Fields for the start and stop.
Lets say you set them as @startdate and @enddate.

On your form you create two fields (or use calander) call them startdate and enddate.
(you will need to add your own error check on the form level)

On your Access Report in the Property "input parameters".

@startdate = Forms!Yourform!startdate,@enddate = Forms!Yourform!enddate

Jim
Users <> Logic
Go to Top of Page
   

- Advertisement -