Hi all
I am having a problem with filling a text box on a report. What happens is as follows:
When the report opens a text box's control source is set to a field of a table. On the Detail_format section of the report I am calling a function that reads in the information from the text box and parses it to a specific format. What I then want to do is write this new text back into the text box. I am trying to set the text box's control source property to the parsed text but i get the following error message -> "You can't set the control source property in print preview or after printing has started". To get around this I made the text box I am reading from invisible and added a label over it to feed the parsed text back into. This works fine except that there is no word wrap or can grow property in a label, so some of the text is missing in the report.There is no way of knowing how much text will be filled into this label at any one time so its needs to be dynamic.
Has anyone any suggestions?
Thanks
Erin
I am having a problem with filling a text box on a report. What happens is as follows:
When the report opens a text box's control source is set to a field of a table. On the Detail_format section of the report I am calling a function that reads in the information from the text box and parses it to a specific format. What I then want to do is write this new text back into the text box. I am trying to set the text box's control source property to the parsed text but i get the following error message -> "You can't set the control source property in print preview or after printing has started". To get around this I made the text box I am reading from invisible and added a label over it to feed the parsed text back into. This works fine except that there is no word wrap or can grow property in a label, so some of the text is missing in the report.There is no way of knowing how much text will be filled into this label at any one time so its needs to be dynamic.
Has anyone any suggestions?
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'expr is name of text box
ParseSyntax (Me![expr])
'trying to feed the results of the ParseSyntax function
'back into the text box
Me![expr].Properties("ControlSource") = parseContents
Erin