Prompt for date of report and using result.

  • Thread starter Thread starter MPgov
  • Start date Start date
M

MPgov

Hello all. I am a novice at Access but hoping someone can help me.

I am trying to open a report with a popup that requires input of a specific
date. But, I want to keep this date and insert it into an unbound control on
the report. I have the following on the “On Open†event of the report:

Private Sub Report_Open(Cancel As Integer)
Dim myPrompt As String
Dim value1As String
Dim NewProposalDate As Date

On Error GoTo ErrHandler

Const myTitle = "View Cost Proposal Report"

myPrompt = "Enter New Proposal Date:"
value1= InputBox(myPrompt, myTitle, Date)
NewProposalDate = value1

MsgBox NewProposalDate2

Exit Sub

ErrHandler:
MsgBox Err.Description

End Sub

This opening input box works well, but I cannot figure out how to save this
“input date†into an unbound control on the report. Any help would be
appreciated.
 
Hello all. I am a novice at Access but hoping someone can help me.

I am trying to open a report with a popup that requires input of a specific
date. But, I want to keep this date and insert it into an unbound control on
the report. I have the following on the ´On Open¡ event of the report:

Private Sub Report_Open(Cancel As Integer)
Dim myPrompt As String
Dim value1As String
Dim NewProposalDate As Date

On Error GoTo ErrHandler

Const myTitle = "View Cost Proposal Report"

myPrompt = "Enter New Proposal Date:"
value1= InputBox(myPrompt, myTitle, Date)
NewProposalDate = value1

MsgBox NewProposalDate2

Exit Sub

ErrHandler:
MsgBox Err.Description

End Sub

This opening input box works well, but I cannot figure out how to save this
´input date¡ into an unbound control on the report. Any help would be
appreciated.

Not sure I understand what you are doing here.
If all you wish to do is have a control on your report display a user
entered date, then, using an unbound text control, set it's controls
source to:

=[Enter a Date]

You will be prompted when the report opens.

However, if you mean you have a form into which you have entered a
date and wish to display that entered date in the report, all you need
do is have an unbound text control.
Set it's control source to:
= Forms!FormName!ControlName

That form must be open when the report is run.
 
Fred,

thank you very much. You answered my question. Yes, I guess I am a novice.
Thanks again.
--
Mp


fredg said:
Hello all. I am a novice at Access but hoping someone can help me.

I am trying to open a report with a popup that requires input of a specific
date. But, I want to keep this date and insert it into an unbound control on
the report. I have the following on the “On Open†event of the report:

Private Sub Report_Open(Cancel As Integer)
Dim myPrompt As String
Dim value1As String
Dim NewProposalDate As Date

On Error GoTo ErrHandler

Const myTitle = "View Cost Proposal Report"

myPrompt = "Enter New Proposal Date:"
value1= InputBox(myPrompt, myTitle, Date)
NewProposalDate = value1

MsgBox NewProposalDate2

Exit Sub

ErrHandler:
MsgBox Err.Description

End Sub

This opening input box works well, but I cannot figure out how to save this
“input date†into an unbound control on the report. Any help would be
appreciated.

Not sure I understand what you are doing here.
If all you wish to do is have a control on your report display a user
entered date, then, using an unbound text control, set it's controls
source to:

=[Enter a Date]

You will be prompted when the report opens.

However, if you mean you have a form into which you have entered a
date and wish to display that entered date in the report, all you need
do is have an unbound text control.
Set it's control source to:
= Forms!FormName!ControlName

That form must be open when the report is run.
 
Back
Top