• Message box syntax error (Access97)

    Author
    Topic
    #453766

    I cannot figure out how to make the following words: “You cannot leave this record blank!” appear as a bold heading using the @ symbol.

    Private Sub Form_Error(DataErr As Integer, Response As Integer)
    If DataErr = 3058 Then
    MsgBox “You cannot leave this record blank!” & vbCrLf & _
    “To correct this error:” & vbCrLf & ” (1) Type a value (any value) into the record.” _
    & vbCrLf & ” (2) Mouse click on the record selector to the left of the record.” & vbCrLf & _
    ” (3) Press the Delete Key.”, vbExclamation
    Response = acDataErrContinue
    End If
    End Sub

    As an alternative, is it possible to automate deletion of the referenced record?

    Thank you,
    Ron

    Viewing 0 reply threads
    Author
    Replies
    • #1124871

      I don’t have 97 any more to try this ( and it does not work in later versions) but this is supposed to work:

      Msgbox “Bold Line@Plain Line@Another Plain Line”, vbInformation+vbOKOnly, “Formatting sample”

      For your second question, can you explain more fully what you want deleted.

      • #1124912

        After much trial and error, I was able to resolve the problem. When using the @ symbols in the message box line to get the bold text on the first line, it was necessary to make the MsgBox statement on one line with no vbCrLf included. Anything else would give me a syntax error. The second part was resolved with a Me.Undo after the MsgBox statement (which returned the record to its previous state). The msgbox statement was then changed to reflect the necessary users actions to avoid the error.

        Thank you.
        Ron

    Viewing 0 reply threads
    Reply To: Message box syntax error (Access97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: