InputBox data pushed to unbound Rpt Control

A

Andy

Hi;

Been searching for InputBox code example that would copy the data entered by
the user at the InputBox prompt and paste it in an Unbound Control on a
Report.

Where can I find an example that uses an InputBox to prompt a user for an
answer and then uses that answer in an unbound Control in a rpt.

Have this sample under a cmdButton OnClick Event.

When the User clicks the cmdButton a message box appears asking them if they
want to print or preview the rpt. (vbYesNoCancel)

On either Yes or No

IF Form chkbxName = False Then

Input Box "What is Your Name".

The answer is "Pasted?" into an Unbound Txt Control box in the rpt.

Else

Use the data from a Control on the Open Form in the Unbound Text Control

Docmd.OpenReport.

End If

The question is where can I find an example that uses an InputBox to prompt
a user for an answer and then uses that answer in an unbound Control in a
rpt.

Thank You for taking the time to read this post.

Andy
 
M

Marshall Barton

Andy said:
Been searching for InputBox code example that would copy the data entered by
the user at the InputBox prompt and paste it in an Unbound Control on a
Report.

Where can I find an example that uses an InputBox to prompt a user for an
answer and then uses that answer in an unbound Control in a rpt.

Have this sample under a cmdButton OnClick Event.

When the User clicks the cmdButton a message box appears asking them if they
want to print or preview the rpt. (vbYesNoCancel)

On either Yes or No

IF Form chkbxName = False Then

Input Box "What is Your Name".

The answer is "Pasted?" into an Unbound Txt Control box in the rpt.

Else

Use the data from a Control on the Open Form in the Unbound Text Control

Docmd.OpenReport.

End If

The question is where can I find an example that uses an InputBox to prompt
a user for an answer and then uses that answer in an unbound Control in a
rpt.


You can not "push" values into a report. It is very easy
for a report to "pull" a value from a from.

Your code need to place the result of the inbut box on a
(hidden?) text box on the form:

If Not chkbxName Then
Me.textboxname = InputBox("Enter your name")
Else
Me.textboxname = Me.[a Control]
End If
Docmd.OpenReport . . .

Then the report can get the information from the form using
a expression in the text box:
=Forms!theform.textboxname
 
A

Andy

GENTLEMAN;

Thank You!

Andy


Marshall Barton said:
Andy said:
Been searching for InputBox code example that would copy the data entered
by
the user at the InputBox prompt and paste it in an Unbound Control on a
Report.

Where can I find an example that uses an InputBox to prompt a user for an
answer and then uses that answer in an unbound Control in a rpt.

Have this sample under a cmdButton OnClick Event.

When the User clicks the cmdButton a message box appears asking them if
they
want to print or preview the rpt. (vbYesNoCancel)

On either Yes or No

IF Form chkbxName = False Then

Input Box "What is Your Name".

The answer is "Pasted?" into an Unbound Txt Control box in the rpt.

Else

Use the data from a Control on the Open Form in the Unbound Text
Control

Docmd.OpenReport.

End If

The question is where can I find an example that uses an InputBox to
prompt
a user for an answer and then uses that answer in an unbound Control in a
rpt.


You can not "push" values into a report. It is very easy
for a report to "pull" a value from a from.

Your code need to place the result of the inbut box on a
(hidden?) text box on the form:

If Not chkbxName Then
Me.textboxname = InputBox("Enter your name")
Else
Me.textboxname = Me.[a Control]
End If
Docmd.OpenReport . . .

Then the report can get the information from the form using
a expression in the text box:
=Forms!theform.textboxname
 

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