Text Box Char Limit

M

Mathew Winder

I'm having trouble with a text box in a form limiting the number of
characters to 255. I understand that this is a common occurance when the
field type is set to Text, but this particular field is set to the Memo type.
There is also no option in the table's design view to change the maximum
number of characters.

Any help on this would be greatly appreciated - thanks!
 
J

John W. Vinson

I'm having trouble with a text box in a form limiting the number of
characters to 255. I understand that this is a common occurance when the
field type is set to Text, but this particular field is set to the Memo type.
There is also no option in the table's design view to change the maximum
number of characters.

Any help on this would be greatly appreciated - thanks!

Be sure that there is no Format specified on the field in the table, or on the
textbox on the form; and that you're not sorting by this field in the form's
Recordsource. Either of these will truncate the memo.
 
M

Mathew Winder

Thanks for the responses!

There is no formatting either on the field or the form text box. The text
box is populated when a user selects which record to view from a list box.
The memo field is a column in the list box, and - using an after update code
on the list box - is fed into the textbox: Me.txtBox =
Me![listBox].Column(10). Otherwise there are no functions or code that
pertain to it.
 
J

John W. Vinson

Thanks for the responses!

There is no formatting either on the field or the form text box. The text
box is populated when a user selects which record to view from a list box.
The memo field is a column in the list box, and - using an after update code
on the list box - is fed into the textbox: Me.txtBox =
Me![listBox].Column(10). Otherwise there are no functions or code that
pertain to it.

That's the problem!

A listbox is not infinitely wide, and cannot contain a full memo field. Access
will truncate the field to put it into the listbox.

If the listbox contains the primary key field of the table containing the memo
as its bound column, you can use it with DLookUp to display the memo field
from the table:

=DLookUp("memofield", "tablename", "ID= " & [listbox])

Of course this won't be editable, but neither will your original solution.

What's the Form's recordsource? What table contains the memo? Could you
perhaps display the memo field in a Subform?
 
M

Mathew Winder

I thought it might be truncated by the listbox; thanks for the explanation of
that.

I've gotten a solution figured out with the DLookup function to get the form
doing exactly what I need - it's working wonderfully! For someone who is
just starting to get their feet wet with Access and VBA, I think DLookup will
be a great new tool in the arsenal.

Thanks again.

John W. Vinson said:
Thanks for the responses!

There is no formatting either on the field or the form text box. The text
box is populated when a user selects which record to view from a list box.
The memo field is a column in the list box, and - using an after update code
on the list box - is fed into the textbox: Me.txtBox =
Me![listBox].Column(10). Otherwise there are no functions or code that
pertain to it.

That's the problem!

A listbox is not infinitely wide, and cannot contain a full memo field. Access
will truncate the field to put it into the listbox.

If the listbox contains the primary key field of the table containing the memo
as its bound column, you can use it with DLookUp to display the memo field
from the table:

=DLookUp("memofield", "tablename", "ID= " & [listbox])

Of course this won't be editable, but neither will your original solution.

What's the Form's recordsource? What table contains the memo? Could you
perhaps display the memo field in a Subform?
 

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