Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Onekama, Michigan, USA
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Message box syntax error (Access97)

    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

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Message box syntax error (Access97)

    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.
    Regards
    John



  3. #3
    Star Lounger
    Join Date
    Apr 2002
    Location
    Onekama, Michigan, USA
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Message box syntax error (Access97)

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •