Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 23rd, 2007, 06:44 AM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default search data echo

Hi, i have a report from a query where users can choose between
two dates: like
choose the start date: ** ** ****
                              OK

Then

choose the end date: ** ** ****
                             OK
After that the users get a report with items between those dates.
My question is: How can i echo the dates that they fill in in my report?



Reply With Quote
  #2 (permalink)  
Old January 23rd, 2007, 08:30 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Use Min and Max.

Create two controls on the header of the report, and then use Min and Max on the Date field in the control:

=Min([MyDateField])
=Max([MyDateField])

Then create labels and put this:

"Between "
Then the Min text box
" and "
Then the Max text box.

HTH


mmcdonal
Reply With Quote
  #3 (permalink)  
Old January 23rd, 2007, 09:15 AM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It works but not exactly what i mean, now i see the start and end date of the items.
But i have to see just the date i choose before the report openings.

Reply With Quote
  #4 (permalink)  
Old January 23rd, 2007, 09:19 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Now I am not sure what you want. Do you want to give them a date picker or combo box to select the dates? Or do you want a messagebox to pop up confirming their selections?

Normally I use a form with two combo boxes, and both of them look up the date fields (Unique Values = Yes). Then the query uses criteria to take the values from the combo box. Alternatively you can package the WHERE clause of the query using code to make sure that the start date comes before the end date.

Can you explain what you want here?



mmcdonal
Reply With Quote
  #5 (permalink)  
Old January 23rd, 2007, 09:57 AM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

when you have a query you can say =<[start date] AND =>[end date]
so when i make a report the rapport asc me to fill the falues.
So i fill 01-01-2007 and that klik on OK.
The next optien i fill 10-01-2007 and klik OK
So i get the report with the items that has been hired between this dates.
But the dates are not showing up. So if i print the report i dont get to see the period i selected ( 01-01-2007 till 10-01-2007)
So i need to echo the value that i has enter befre the report starts. The begin and end date.

You understand? if not than i try to make pictures
Thank you

Reply With Quote
  #6 (permalink)  
Old January 23rd, 2007, 10:02 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am still not sure if you want to "echo" the values in a messagebox to the user before the report opens, or if you want it to appear in a print out.

You say "But the dates are not showing up." Where are they not showing up? Can you add the field to your report?


mmcdonal
Reply With Quote
  #7 (permalink)  
Old January 23rd, 2007, 10:40 AM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I want to see the dates after the user has filled in, in to the textbox.

So when i print my report i can see the selected date.

Reply With Quote
  #8 (permalink)  
Old January 23rd, 2007, 10:54 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am not sure why putting the text boxes at the top of the report with the Min and Max values does not do this. These text boxes will display those dates. Just label them as the start and end dates.

An alternative, if the dates are not exact, is to capture them in Public variables, and pass those to the text boxes.

Create two public variables in a module, like this:

Public pStartDate, pEndDate As Date

Then remove the criteria from the query.

On the On Click event of the button to open the report, put this code:

Dim sDocName, sLink as String

pStartDate = InputBox "Please enter a start date:"
pEndDate = InputBox "Please enter an end date:"

sDocName = 'rptYourReportName"
sLink = "[DateField] >= #" & pStartDate & "# And <= #" & pEndDate & "#"

DoCmd.OpenReport sDocName, , , sLink 'check the syntax

Then for the text boxes, put the recordsource as pStartDate and pEndDate.

Perhaps that will do what you want.

HTH

mmcdonal
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need a echo wizard Anne1 PHP How-To 1 December 16th, 2006 04:20 AM
Echo Data To Textarea Box? robo_z Beginning PHP 1 February 9th, 2006 04:59 AM
echo "\n" problem jun99 PHP How-To 4 November 29th, 2005 01:01 PM
echo "\n" problem jun99 Beginning PHP 0 November 27th, 2005 05:12 PM
using echo command to display "$" Tachyon PHP How-To 3 March 1st, 2004 09:54 PM



All times are GMT -4. The time now is 06:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.