Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MaxLength for TextBox (255?) &Label(2000?), CanGrow &CanShrink feature

Status
Not open for further replies.

JenniferD9

Programmer
Jun 5, 2003
7
US
Hello, I'm a newbie...

1. What's the max length that can be displayed for the TextBox and Label box (Unbound) in Access?

2. I have a string, 4000 characters long, and would like to store it in either TextBox or Lable field (Unbound). Would this be possible?
example:
reports!rptMyReport!lblMyComments.Caption = strMyComments
-(this will work up to 2000 char.) :eek:(

reports!rptMyReport!txtMyComments = strMyComments
-(got "Run-time error '2448'... You can't assign a value
to this object")
-I've used .Text and .Value, both got same error
-I've tried the suggested article about the 'IsLoaded Function' which was posted the Tek-Tips. This doesn't do anything for me. I still get the same error.
-I've used the SetFocus but it doesn't work in the Report.

3. In the TextBox property, there's a CanGrow and CanShrink feature. Is there one for the Label? I cannot find it... How would I achieve the same feature as the TextBox?

Thanks in advance!
JenniferD :eek:)


 
While I've never had the need to do this myself, I would think you would have to write your records to a temporary table with strMyComments written to a memo type field. Then base your report off of this temporary table. Since the control source is a memo field this should handle the length.....
 
Thanks for your suggestion, CosmoKramer. The strMyComments comes from a table with multi-comments and feeds into one big comment, it's like comment history. It's a string and I need to be able to display it in the report into either a TextBox or Label field (be able to hold up to 4,000 characters).

Thanks,
JenniferD :eek:)
 
I got it to work! :eek:)
Since I can't directly feed in the global parameter to the unbound field in a REPORT, I created an unbound field on the FORM and pass in the global parameter to the unbound field and have it hidden... THEN when I open the Report (Unbound), I hard-coded the comments field(TextBox) back in the SourceControl properties.

FORM:
txtTempComments.Value=strComments

REPORT: (from properties screen)
Name: txtComments
ControlSource: =forms!frmDesc!txtTempComments
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top