Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    replace the access message (Access 2000)

    Replace the Access message with my own

    I have a function for finding a code number.If the user clicks the control, the
    question appears "Pleased enter the code number". If the user does not enter a code
    a debug window appears witrh the message "syntax error". I want to avoid this message
    and put my own message and either do not proceed further or exit the sub.I have tried with the
    Exit Sub, but again the mesage debug appears.How can i insert my own command in the folowing function?:


    Dim strCode As String
    Dim strBookmark As String
    strBookmark = Me.Bookmark
    strCode = InputBox("Please enter Code number ")
    Me.RecordsetClone.FindFirst "Code = " & strCode
    If Me.RecordsetClone.NoMatch Then
    MsgBox "Code " & strCode & " Not Found!!"
    Me.Bookmark = strBookmark
    Else
    Me.Bookmark = Me.RecordsetClone.Bookmark
    End If

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: replace the access message (Access 2000)

    Change your code to <pre>Dim strCode As String
    Dim strBookmark As String
    strBookmark = Me.Bookmark
    Do While Len(strCode) = 0
    strCode = InputBox("Please enter Code number ")
    If Len(strCode) = 0 Then
    MsgBox "Enter the code", vbOKOnly
    End If
    Loop
    Me.RecordsetClone.FindFirst "Code = " & strCode
    If Me.RecordsetClone.NoMatch Then
    MsgBox "Code " & strCode & " Not Found!!"
    Me.Bookmark = strBookmark
    Else
    Me.Bookmark = Me.RecordsetClone.Bookmark
    End If</pre>

    Francois

Posting Permissions

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