If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Show date in report

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-18-12, 16:13
sgtpepr sgtpepr is offline
Registered User
 
Join Date: Jan 2012
Posts: 7
Show date in report

My report runs from a query that asks for a date range to pull data from

Between [forms]![set date].[start date] And [forms]![set date].[end date]

I'd like to have this date range show on my report. How do I make that happen?

Thanks,
Don..........
Reply With Quote
  #2 (permalink)  
Old 01-19-12, 03:09
MStef-ZG MStef-ZG is offline
Registered User
 
Join Date: Apr 2005
Location: Zagreb - Croatia
Posts: 344
Look at "DemoDateReportA2000.mdb" (attachment, zip).
Look at Form1 (VBA), table, query, Reoprt1 (VBA).
Open form and try.
Attached Files
File Type: zip DemoDateReportA2000.zip (18.8 KB, 4 views)
Reply With Quote
  #3 (permalink)  
Old 01-19-12, 06:32
sgtpepr sgtpepr is offline
Registered User
 
Join Date: Jan 2012
Posts: 7
Thanks for the help. I'm not sure why but I'm getting a message that says this file was created with newer version than I have. I should have mentioned that I'm using Access 2000 (9.0.6926 SP-3) though I thought your file was also 2000.
I'll try it a home later,
Thanks again for your help,
Don..........
Reply With Quote
  #4 (permalink)  
Old 01-19-12, 07:11
MStef-ZG MStef-ZG is offline
Registered User
 
Join Date: Apr 2005
Location: Zagreb - Croatia
Posts: 344
Sorry, it is Access 2002-2003.
Here is Demo Access 2000.
Attached Files
File Type: zip DemoDateReport2A2000.zip (16.0 KB, 3 views)
Reply With Quote
  #5 (permalink)  
Old 01-24-12, 18:42
sgtpepr sgtpepr is offline
Registered User
 
Join Date: Jan 2012
Posts: 7
Show date in report

I've tried the demo you sent me. It works but it's not exactly what I wanted to do.
I'm attaching my db. My report almost works but I get a #Name? error. I don't understand why.
The only dates you can plug in when prompted are 1/1/12 & 1/17/12 (start and end). However when I look for it at the bottom of my report I get that error #Name?

What am I missing?

Thanks again for all your help.
Don..........
Attached Files
File Type: zip LMM Hydro Leaks_1-24-12.zip (119.2 KB, 3 views)
Reply With Quote
  #6 (permalink)  
Old 01-25-12, 03:51
MStef-ZG MStef-ZG is offline
Registered User
 
Join Date: Apr 2005
Location: Zagreb - Croatia
Posts: 344
The error is:
In the form "Set Date" the name of the field Start Date is "Text3" (not Start Date). The name of the field End Date is "Text5" (not End Date).
Change it or in the form or in the queries (datesubquery, Mainquery) and in LMN Report too.
Reply With Quote
  #7 (permalink)  
Old 01-25-12, 06:37
sgtpepr sgtpepr is offline
Registered User
 
Join Date: Jan 2012
Posts: 7
I'm not sure what I'm doing wrong or missing. I changed the mainquery, datesubquery and LMM report to read
text3/text5
but it's still giving me the #name? error.


Mainquery & datesubquery
Between [forms]![set date].[text3] And [forms]![set date].[text5]

Set Date (Form)
text3 (for start date)
text5 (for end date)

(Control Source in LMM Report)
=[Forms]![Set Date].[text3]
=[Forms]![Set Date].[text5]


I also thought if I'd just change the names in the text boxes of the SetDate form to "Start Date" & "End Date" it would be the same as everything else.
Neither of these ideas worked.

Can you tell me what I'm doing wrong?
Thanks for your help,
Don.............
Reply With Quote
  #8 (permalink)  
Old 01-25-12, 07:35
MStef-ZG MStef-ZG is offline
Registered User
 
Join Date: Apr 2005
Location: Zagreb - Croatia
Posts: 344
It must be you make a mistake somewhere.
Reply With Quote
  #9 (permalink)  
Old 01-25-12, 11:59
sgtpepr sgtpepr is offline
Registered User
 
Join Date: Jan 2012
Posts: 7
I've looked at this until my eyes have crossed, but I still don't see what is wrong. Below is what is in my db. I didn't type this, I copied and pasted it from my db. Can you look and tell me what is wrong or what I should do?

datesubquery
Date Tested (column)
Between [Forms]![set date].[start date] And [Forms]![set date].[end date]

Mainquery
Date Tested
Between [Forms]![set date].[start date] And [Forms]![set date].[end date]

LMM Report
From
=[Forms]![set date].[start date]
To
=[Forms]![set date].[end date]

Set Date (Form)
Name
Text3
Text5

Would it make sense to just change the Text3 & Text5 in the Set Date (Form) to read Start Date & End Date? Wouldn't that be the same as changing everything else to Text3 & text5? Although I did that also and still got the error message.

I apologize for being this dense but I don't see it.

Thanks very much for your help and patience.
Don.........
Reply With Quote
  #10 (permalink)  
Old 01-25-12, 14:03
sgtpepr sgtpepr is offline
Registered User
 
Join Date: Jan 2012
Posts: 7
I believe I've resolved my problems. I never did get the Report to show the dates but I did get the command button in the Set Date Form to show the dates.
So what I did was added a button to my LMMKDATACOLLECTOR form that opens the Set Date form. Once in set date I input the dates and the Report opens up and shows the dates.
If my explanation confuses you I'm sorry because I don't know how to describe it any other way.
I do appreciate all your help and your patience.
Thanks,
Don..........
Reply With Quote
  #11 (permalink)  
Old 01-25-12, 14:25
Sam Landy Sam Landy is offline
Registered User
 
Join Date: May 2004
Location: New York State
Posts: 931
Do you want a real easy way to show the date range on the report? Try this:

1 - add two fields to your query as follows:

Code:
SDate: [forms]![set date].[start date]
and

Code:
EDate: [forms]![set date].[end date]
I assume your query already includes the criteria as a WHERE field:

Code:
Between [forms]![set date].[start date] And [forms]![set date].[end date]
2 - In your report, add two textboxes in the page header section with the two field names, SDate and EDate, and set their Visible property to No.

3 - Add a new textbox in the page header section. Set the Source property to
Code:
= "From #" & SDate & "# to #" & EDate & "#"
Of course, you can modify the text. Just make sure you have the equal sign, the hash marks, and the double quotes in the right places, or it won't work properly.

Sam
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 On
Pingbacks are On
Refbacks are On