problem writing text to textbox

P

PayeDoc

Hello All

I have a procedure that builds an xml file and then sends it to a 3rd
party - a government online server. The final part of the process is when an
acknowledgement is received from the government online server: this is
returned by the procedure as 'ResponseText', which I then need to write to
the texbox 'txtServerResponse' on the current form. I was expecting to be
able to do this very simply with

txtServerResponse.Text = ResponseText

.... but for some reason I keep getting runtime error 2176 and a message that
"The setting for this property is too long", and clicking debug takes me to
the line

txtServerResponse.Text = ResponseText

I have checked the properties of the textbox 'txtServerResponse', and can
see no restriction that should cause the problem. Initially,
txtServerResponse was bound to a memo field from the form's underlying
table, but in fact I have also tried replacing it with an unbound textbox,
but this made no difference. I know that txtServerResponse is able to accept
the value of 'ResponseText', because when I add

Debug.Print ResponseText

to the procedure, then do ctrl-G and copy the text I can paste it into
'txtServerResponse' without a problem. I have found that I can even use

Call ClipBoard_SetData(ResponseText)

to put 'ResponseText' directly onto the clipboard, from were I can paste it
into 'txtServerResponse'.

The end of the procuedure is currently as follows:

Private Sub mcls2P45_ServerResponse(ResponseText As String)
txtServerResponse.SetFocus
txtServerResponse.Text = ""
txtServerResponse.Text = ResponseText
Debug.Print ResponseText
Call ClipBoard_SetData(ResponseText)
End Sub

.... but I can only get past the line txtServerResponse.Text = ResponseText
by commenting it out.

If anyone can suggest a likely cause for this I would be very grateful. As a
(hopefully short-term) workaround, does anyone know the 'paste' equivalent
to Call ClipBoard_SetData(ResponseText), so that I could get the value of
'ResponseText ' into 'txtServerResponse' that way?

Many thanks for any help.
Leslie Isaacs
 
P

PayeDoc

Hello Linq

Very many thanks for your reply: removing the .text has done it!

Thanks again
Les
 

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