print the contents of a control

  • Thread starter Thread starter Calvin X
  • Start date Start date
C

Calvin X

Hi All,

Is there a way for me to print the value in a control. I have a large text
box and want to print only its value but when I use DoCmd.PrintAll() (using
the selected values in the texdt box) I get the whole form printed and not
all of the text in the text box.

Thanks

Calvin X
 
I would create a report that contains the information you want (perhaps it
contains only the contents of this one field). You could then use

DoCmd.OpenReport "YourReportName", acViewNormal

You have much better control over what is going to print and how it will
look using a report rather than trying to print a form.

Linda
 
Thanks but I tried that >> the controlsource property gives me a 2048
character limit error.
 
Calvin said:
Thanks but I tried that >> the controlsource property gives me a 2048
character limit error.

The ControlSource would only need to hold the name of the field, not its
contents.
 
Calvin X said:
Thanks but I tried that >> the controlsource property gives me a 2048
character limit error.

You need to create a report that is BOUND to the table, and place the one
field on the report. This will result in a BOUND textbox on the report..

You code to open up the repot to the ONE record would be:

me.Refresh 'have to write record to disk before report grabs it..

docmd.OpenReport "myReport",acViewPreview,,"id = " & me!id

The above assumes a primary key value of id, and will restrict the report to
the ONE record....


The above should work....
 
Thanks guys but that wont solve my problem. Here is my situation:

I am using an unbound text box on a form to load a text file log that I
create after performing several opertations. this is a standard log viewing
form. the contents of this form are to be transferred to the report object
text box but the only way to do this is to set the ControlSource of the
textbox when the report opens. This is when I get the error about the 2048
character limit. I suppose I could use a shell command to open the
notebook.exe program but I run this application through a citrix portal and
do not want multitple apps running in a single session.

There must be a way to either A) the the contents of a text box to the
printer or to B) set the control source of the report to be the lengthy
string i have.


Thanks


Calvin x
 
Calvin said:
Thanks guys but that wont solve my problem. Here is my situation:

I am using an unbound text box on a form to load a text file log that
I create after performing several opertations. this is a standard
log viewing form. the contents of this form are to be transferred to
the report object text box but the only way to do this is to set the
ControlSource of the textbox when the report opens. This is when I
get the error about the 2048 character limit. I suppose I could use
a shell command to open the notebook.exe program but I run this
application through a citrix portal and do not want multitple apps
running in a single session.
There must be a way to either A) the the contents of a text box to the
printer or to B) set the control source of the report to be the
lengthy string i have.

Forget the ControlSource. Just leave that blank and then set the Value
property of the TextBox to the Value of the TextBox on the form.

For that matter you might be able to just refer to the TextBox on the form
directly if the form will still be opened when you run the report using a
ControlSource of...

=Forms!FormName!TextBoxName
 
Back
Top