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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

End of a string exists but does not display

Status
Not open for further replies.

Petemush

Technical User
Jun 21, 2002
255
GB
I have a piece of code which builds up a string containing email addresses which is then sent to Outlook to the address line.

This all works fine since in VBA a string has a limit of about 2 billion characters. What is the problem, is that access seems to have a limit of 255 characters when displaying a string. If I put a breakpoint in the code and check the debug window, anything past 255 characters is not displayed in the value. However, if you debug.print the string, the entire string is displayed past 255 characters.

I wouldn't have thought that this would cause a problem since the data is there, you just can't see it, but when I pass the string to outlook, only the limit of 255 characters is passed, yet I know for a fact that the string contains all the data as it shows when you print it in the debug window!

Does anyone know what is causing this and how I could sole it?

Cheers,

Pete
 
Hi,
If you can't use a string variable then why don't you use a textbox? You can have a hidden textbox that you can concatenate all of the email addresses to be exported. I assume that the email addresses are coming from a recordset. You can then refer to the text1.text to get the email addresses.

Have a good one!
BK
 
Sound advice as it sounds, got a couple of problems.

If the textbox is hidden, i.e. visible property set to no, you can't reference it since you need to set the focus to it to reference it and if it's not visible then this is not possible. At least that's everything the error messages are telling me.

If I make the textbox visible the data is fully displayed with all the addresses concatenated together but when I pass text1.text to the function, it still passes a limit of 255 characters because that's the amount of characters that appear in the To: part of the new message.

I've checked the debug window and exactly the same thing occurs, the data is shown if use debug.print in the immediate pane but if you click on the variables value and scroll to the end, it only hass 255 characters displayed. I'm assuming that this is what is causing the problem when passing the string to OutLook, but if the data's there surely there is a way to send it all!

Cheers,

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top