Link to home
Start Free TrialLog in
Avatar of Chuck Lowe
Chuck Lowe

asked on

Custom message box issue

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?

Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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.
Avatar of Chuck Lowe
Chuck Lowe


Thanks. That worked fine