Show message w/ long Character String

  • Thread starter Thread starter Vic
  • Start date Start date
V

Vic

When a user saves a record to the database, some checking
routines are executed. If the checking routines fail, I
genenrate a string w/ everything that failed and display
it in a message box. However, this message is sometimes
to big to show in a message box and eventually trucating
the data that needs to be displayed. I would like to
somehow popup a form with a text box or something that
will show the message. I will need to pass a string
variable to that other form. What is the best way to do
this. Can somebody please help.

TIA,
Vic
 
When a user saves a record to the database, some checking
routines are executed. If the checking routines fail, I
genenrate a string w/ everything that failed and display
it in a message box. However, this message is sometimes
to big to show in a message box and eventually trucating
the data that needs to be displayed. I would like to
somehow popup a form with a text box or something that
will show the message. I will need to pass a string
variable to that other form. What is the best way to do
this. Can somebody please help.

TIA,
Vic

In the event where you wish to open the message box, code:
Dim strMessage as String
strMessage = "blah blah blah" & vbNewLine & "More Blah blah"
DoCmd.OpenForm "frmMessage", , , , , acDialog, strMessage

Create an unbound form.
Add an unbound text control and a command button.
Set the command button CanGrow property to Yes.
Name this form "frmMessage"
Code the command button to close the form:
DoCmd.Close acForm, "frmMessage"

Code the form's Load event:
If Not IsNull(Me.OpenArgs) Then
Me![ControlName] = Me.OpenArgs
End If


When the message form opens the label will display whatever text you
sent it. When you click the command button, the form will close and
the event processing will continue.
 
Hi Vic,

Pass the string in the OpenArgs argument of DoCmd.OpenForm, and
(probably) set the WindowMode argument to acDialog.
 
Back
Top