Variable link to a text box on a form

B

billybanter67

Hello,

I have a series of buttons on a form which open the same report but
with different criteria.
eg
DoCmd.OpenReport stDocName, acPreview, , "Estimator= forms!DataDrill!
Estimator and Debtor= forms!DataDrill!Debtor"

another button has
DoCmd.OpenReport stDocName, acPreview, , "Estimator= forms!DataDrill!
Estimator"

What I would like to have on the report when it opens is a couple of
text boxes which read the criteria off the form,

eg text box

[Reports]![datea test]![TextBox].Value = [Forms]![DataDrill]!
[Estimator].Value

Is this possible?

Rgards

Richard
 
R

Rockn

Me.ControlName = Forms!FormName!ControlName.Value should work as long as the
form is still open.
 
M

Marshall Barton

billybanter67 said:
I have a series of buttons on a form which open the same report but
with different criteria.
eg
DoCmd.OpenReport stDocName, acPreview, , "Estimator= forms!DataDrill!
Estimator and Debtor= forms!DataDrill!Debtor"

another button has
DoCmd.OpenReport stDocName, acPreview, , "Estimator= forms!DataDrill!
Estimator"

What I would like to have on the report when it opens is a couple of
text boxes which read the criteria off the form,

eg text box

[Reports]![datea test]![TextBox].Value = [Forms]![DataDrill]!
[Estimator].Value



Here's two ways to do that. One is to just use the form
reference in the report's text box:

=[Forms]![DataDrill]![Estimator]

Another way is to put the code in the Format event of the
section that contains the text box:

Me.TextBox = Forms!DataDrill!Estimator
 
B

billybanter67

Me.ControlName = Forms!FormName!ControlName.Value should work as long as the
form is still open.


I have a series of buttons on a form which open the same report but
with different criteria.
eg
DoCmd.OpenReport stDocName, acPreview, , "Estimator= forms!DataDrill!
Estimator and Debtor= forms!DataDrill!Debtor"
another button has
DoCmd.OpenReport stDocName, acPreview, , "Estimator= forms!DataDrill!
Estimator"
What I would like to have on the report when it opens is a couple of
text boxes which read the criteria off the form,
eg text box
[Reports]![datea test]![TextBox].Value = [Forms]![DataDrill]!
[Estimator].Value
Is this possible?

Richard

Thanks for your ideas,

I also use the same report for different information.

I have tried

Private Sub Report_Open(Cancel As Integer)
Me.datalist.Value = [Forms]![DataDrill]![Estimator].Value
End Sub

but this doesn't work and comes up with an error.

I tried to use a openargs but I am not sure how this works.

I have a couple of different command buttons that I use to open up the
report with different criteria eg

one is [Reports]![datea test]![TextBox].Value = [Forms]![DataDrill]!
[Estimator].Value and another is
[Reports]![datea test]![TextBox].Value = [Forms]![DataDrill]!
[Debtor].Value

Thanks
 
B

billybanter67

Me.ControlName = Forms!FormName!ControlName.Value should work as long as the
form is still open.


I have a series of buttons on a form which open the same report but
with different criteria.
eg
DoCmd.OpenReport stDocName, acPreview, , "Estimator= forms!DataDrill!
Estimator and Debtor= forms!DataDrill!Debtor"
another button has
DoCmd.OpenReport stDocName, acPreview, , "Estimator= forms!DataDrill!
Estimator"
What I would like to have on the report when it opens is a couple of
text boxes which read the criteria off the form,
eg text box
[Reports]![datea test]![TextBox].Value = [Forms]![DataDrill]!
[Estimator].Value
Is this possible?

Richard

I think the variable has to come from the command button on the form
not in the open report area, is that right?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top