Text box problems

B

Brian

Hi everybody,
I am having a slight problem w/ one of my textboxes. I get
an error 2176, "You can enter up to 255 or 2,048 characters
for this property, depending on the data type." This error
is generated when I attempt to set the .Text of my textbox
equal to a string stored in an array. The weird part is
that this textbox's .Text was unchanged. What this all
does is I have an "Edit" and a "Cancel" button on my form.
When Cancel is clicked, I have Access go through each
textbox and put the values that were in the boxes when Edit
had been pressed, and therefore before the user had made
any changes. The length of the string I'm trying to put
back into the textbox is 2,800 chars w/ spaces. This
textbox is also bound to a memo field. Here's part of the
code that stores the data to the array,
For Each ctl In Forms!FRACA_DATA.Controls
With ctl
If .ControlType = acTextBox Or .ControlType =
acComboBox Then
.SetFocus
strPreEditVals(y) = .Text
y = y + 1
End If
End With
Next ctl

then here is the part that reputs the values back in

For Each ctl In Forms!FRACA_DATA.Controls
With ctl
If .ControlType = acTextBox Or .ControlType =
acComboBox Then
If y <> 22 Then
.SetFocus
.Text = strPreEditVals(y)
End If
y = y + 1
End If
End With
Next ctl


thanks to anyone that can help me out.
 

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