Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 18th, 2004, 01:00 AM
zxmax zxmax is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 14 zxmax User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question date pulled from unbound form

Here is my scenario:
I have a form called "Date Range" which has 2 unbound feilds , i use this as a popup Form throught my database when i want to print my report, so i could filter specific date, this part works just fine,

On one of my reports, "end of year report" i want to show the date slected by the user in the "date Range" entered .. is there any i could do that, since these dates are not stored anywhere ?

I hope i was clear explaining my problem.. Thanks in adavance

Reply With Quote
  #2  
Old March 18th, 2004, 02:52 AM
MrLoveMe MrLoveMe is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Pacific NW
Posts: 4 MrLoveMe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I would use a global variable

Quote:
Originally Posted by zxmax
Here is my scenario:
I have a form called "Date Range" which has 2 unbound feilds , i use this as a popup Form throught my database when i want to print my report, so i could filter specific date, this part works just fine,

On one of my reports, "end of year report" i want to show the date slected by the user in the "date Range" entered .. is there any i could do that, since these dates are not stored anywhere ?

I hope i was clear explaining my problem.. Thanks in adavance
This is how I would do it. Carry the dates with a public variable:

Attached is the code in a blank database.

FORM CODE:

Option Compare Database
Option Explicit
Public datDate1 As Date
Public datDate2 As Date
Private Sub btnReportOpen_Click()
On Error GoTo Err_btnReportOpen_Click
Dim strDocName As String

strDocName = "Report1"
datDate1 = Me.txtDate1
datDate2 = Me.txtDate2
DoCmd.OpenReport strDocName, acViewPreview

Exit_btnReportOpen_Click:
Exit Sub
Err_btnReportOpen_Click:
MsgBox Err.Description
Resume Exit_btnReportOpen_Click

End Sub

REPORTCODE:

Private Sub Report_Open(Cancel As Integer)
Me.lblDate1.Caption = Forms!form1.datDate1
Me.lblDate2.Caption = Forms!form1.datDate2
End Sub
Attached Files
File Type: zip db1.zip (15.0 KB, 210 views)

Last edited by MrLoveMe : March 18th, 2004 at 03:01 AM.

Reply With Quote
  #3  
Old March 18th, 2004, 11:16 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Another alternative to MrLoveMe

In Access, I usually capture the dates (for the date range), in my query as a caculated field

Select *, [Forms]![form1].[datDate1] AS BegDate, [Forms]![form1].[datDate2] as EndDate From Table1

This way the become part of the query and are now captured and can be used in the report


Both alternatives work, it is a matter of preference

S-

Reply With Quote
  #4  
Old March 18th, 2004, 09:41 PM
zxmax zxmax is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 14 zxmax User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

Perfect, that is exactly what i wanted, Thnaks for both reply, specially Mrloveme, it is always easy to see the codes, again thanks for the attachement,

Now i have very very minor problem, the date now is showing in this format 1/2/2004 in the report, now i would like to change the it to 1 Feb 2004 , Note, that i DID change the input Mast in the FrmDate ,, i looked in the unbound properties but there is no option for Input mast , or date formate , since its an unbound box,

Thanks again for the great support

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > date pulled from unbound form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT