Custom message box issue

Chuck Lowe
Chuck Lowe used Ask the Experts™
We have a custom messagebox. Due to the fact of company logo, colors etc. Can't get away from that.
the code on the form is

Private Sub Form_Load()
    On Error GoTo ERR_SUB
        Me.lblMessage.Caption = Me.OpenArgs 'Value which is passed in
Sometimes the data is large (number of characters) I want to pass. I get an error that the OpenForm Action was cancelled.
I'm not sure if this is due to the string limitation (255) or that it's displaying in a label or both. The individual lines have vbCrLf so the display is nicely formated. Is my limitation the string length? The caption length? Should I use a textbox? Or should I change it to a ListBox?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
i'll prefer to use a textbox...
Well, the openargs is not limited to 255 characters, so that can't be it. I'm guessing something else is going on, perhaps there is code you are not showing us?

And note, if your form is allready open in design mode, because your testing or similar, then the OpenArgs are NOT passed to the form. So make sure your form is properly closed, before testing it.
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

And lets be clear, ...the title here is a bit misleading, ...
This is not a "messagebox" (object), seems to be a form with custom text that appears in a label...

Note here that you are not giving us an example of this mystery, long, string, ...or telling us how you are incorporating the vbcrlf...

Can you post the entire code please?
There are many reasons why the load event could be canceled.


Thanks. That worked fine

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial