|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
I would use a global variable
Quote:
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 Last edited by MrLoveMe : March 18th, 2004 at 03:01 AM. |
|
#3
|
|||
|
|||
|
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- |
|
#4
|
|||
|
|||
|
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 |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > date pulled from unbound form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|