Unbound report with prompt for data entry?

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

Access 2000. Is there a way to have a report prompt the user for the date
and an office number even though there is no table bound to it? I do not
need to store this info...Randy
 
Couldn't you just prompt using a msg box? Maybe on the Report Load somehow?
If it doesn't need to be stored, why prompt?
 
How about using the InputBox function and assigning the value to your
unbound control?

Me.SomeControl=InputBox("What Office number?")
Me.SomeOtherControl=InputBox("What Date?",,Date())
 
You can add a text box to a report with a control source like:
=[Enter a date]
or
=[Enter an office number]
 
I tried this on my report "On Open" Had runtime error "Cannot assign value
to this object" [District" is a txtbox on my report.
Private Sub Report_Open(Cancel As Integer)
Me.District = InputBox("What Office number?")
End Sub
 
Randy said:
I tried this on my report "On Open" Had runtime error "Cannot assign value
to this object" [District" is a txtbox on my report.
Private Sub Report_Open(Cancel As Integer)
Me.District = InputBox("What Office number?")
End Sub

You can do that in the Detail_Format event.



--
 
How about the following?

Option Compare Database
Option Explicit
Dim strA As String

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.District = strA
End Sub

Private Sub Report_Open(Cancel As Integer)
strA = InputBox("What Office number?")
End Sub

Randy said:
I tried this on my report "On Open" Had runtime error "Cannot assign value
to this object" [District" is a txtbox on my report.
Private Sub Report_Open(Cancel As Integer)
Me.District = InputBox("What Office number?")
End Sub
John Spencer said:
How about using the InputBox function and assigning the value to your
unbound control?

Me.SomeControl=InputBox("What Office number?")
Me.SomeOtherControl=InputBox("What Date?",,Date())
 
Not sure why any code is needed when you can "bind" a text box to a prompt
like:
=[Enter Something]
or do it in your query:
Something: [Enter Something]

Don't get me wrong, I love writing code but why use it when you don't have
to?

--
Duane Hookom
MS Access MVP
--

John Spencer said:
How about the following?

Option Compare Database
Option Explicit
Dim strA As String

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.District = strA
End Sub

Private Sub Report_Open(Cancel As Integer)
strA = InputBox("What Office number?")
End Sub

Randy said:
I tried this on my report "On Open" Had runtime error "Cannot assign
value to this object" [District" is a txtbox on my report.
Private Sub Report_Open(Cancel As Integer)
Me.District = InputBox("What Office number?")
End Sub
John Spencer said:
How about using the InputBox function and assigning the value to your
unbound control?

Me.SomeControl=InputBox("What Office number?")
Me.SomeOtherControl=InputBox("What Date?",,Date())

Access 2000. Is there a way to have a report prompt the user for the
date and an office number even though there is no table bound to it? I
do not need to store this info...Randy
 
Yep! For some reason that didn't occur to me. After all the times I've
fought with prompts for misspelled control sources, it should have.

Good call.

Duane Hookom said:
Not sure why any code is needed when you can "bind" a text box to a prompt
like:
=[Enter Something]
or do it in your query:
Something: [Enter Something]

Don't get me wrong, I love writing code but why use it when you don't have
to?

--
Duane Hookom
MS Access MVP
--

John Spencer said:
How about the following?

Option Compare Database
Option Explicit
Dim strA As String

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.District = strA
End Sub

Private Sub Report_Open(Cancel As Integer)
strA = InputBox("What Office number?")
End Sub

Randy said:
I tried this on my report "On Open" Had runtime error "Cannot assign
value to this object" [District" is a txtbox on my report.
Private Sub Report_Open(Cancel As Integer)
Me.District = InputBox("What Office number?")
End Sub
How about using the InputBox function and assigning the value to your
unbound control?

Me.SomeControl=InputBox("What Office number?")
Me.SomeOtherControl=InputBox("What Date?",,Date())

Access 2000. Is there a way to have a report prompt the user for the
date and an office number even though there is no table bound to it?
I do not need to store this info...Randy
 
Actually, this worked perfectly, Thanks a lot.
= InputBox("What Office number?")


Duane Hookom said:
You can add a text box to a report with a control source like:
=[Enter a date]
or
=[Enter an office number]

--
Duane Hookom
MS Access MVP
--

Randy said:
Access 2000. Is there a way to have a report prompt the user for the
date and an office number even though there is no table bound to it? I
do not need to store this info...Randy
 
Back
Top