Overcoming text value too long problem Textbox in Access 2000

  • Thread starter Thread starter robbinma
  • Start date Start date
R

robbinma

Hello,

As part of my application I have a procedure that does a lot of work
behind the scenes like importing files etc.
I would like to "report" to the user at the end of the process what has
happened with the procedure.
In VB I would use a Rich Text Box but that isn't available in Access
2000.
I have been building up a string that contains the various status
messages as they arrive
I have opted to use a textbox but Access is complaining that the text
value is too long (2000 ish) characters.
Any ideas on alternatives. I don't really want to have to insert the
text into a table and then produce a proper report as that would be
overkill.
I guess the other alternative is to build up a collection of strings
and then populate a listbox but that doesn't bear thinking about.

Any thoughts welcome,

Mark
 
Mark,
Sounds like you need a MEMO control instead of a Text control. Odd
though... a Text control can contain up to 255 chars, so I don't know how
you've been able to get 2000 chars in there so far??

From Help...
Use the Memo data type if you need to store more than 255 characters. A Memo
field can store up to 64,000 characters. Memo fields can't be indexed or
sorted.

I'm not sure what you're doing here, but I would use a table to store
each returned value (as your processes run), rather than either a Memo or
Text.
 
Assuming that the Text box is unbound you should be OK. I have tested up to
64K without error in an unbound text box. If the text box is bound, then
the underlying field will be the limiting factor. BTW Access does not have
a Memo Control, but does have a Memo Field.
Code

Dim i As Integer, strX As String
For i = 1 To 2909
strX = strX & "12345678901234567890, "
Next
Text0.Value = strX
Debug.Print Len(Text0.Value) & " length."

Prints "63998 length." in the immediate window when run, and allows the user
to enter two more key storkes before complaining.

Ron W
Al Campagna said:
Mark,
Sounds like you need a MEMO control instead of a Text control. Odd
though... a Text control can contain up to 255 chars, so I don't know how
you've been able to get 2000 chars in there so far??

From Help...
Use the Memo data type if you need to store more than 255 characters. A Memo
field can store up to 64,000 characters. Memo fields can't be indexed or
sorted.

I'm not sure what you're doing here, but I would use a table to store
each returned value (as your processes run), rather than either a Memo or
Text.
 
Thanks guys setting the value property works.
I had been setting the text property hence the problem.

Just to clarify what I was trying to do.
There is a String variable that is used to contain status messages
e.g.
"Importing file XXX into table Y"
"Finished file XXX"
During testing these messages were output to the immediate window using
Debug.print

My testers won't be familiar with VBA and I can't expect them to use
the immediate window so I need to provide some way for them to see the
messages. A quick and dirty solution is to append them together into a
very long string and then display them in a textbox.
I tried setting the text property on my unbound textbox and got the
problem that started this thread.

It now looks like I should have used the value property :rolleyes:
instead. I'm still not sure I understand the difference between the
text/value properties but it works.

Just to clarify an earlier comment, I had been building up my string to
2000 characters and it had always failed.

I could use a table to store the messages/values but it would be
overkill for the application. I have got it down as a future
enhancement if the project scope gets bigger.

Thanks again,

Mark
 
Back
Top