Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Check for New Record (Access 2K)

    How can I check if the user really wants to add a new record and, IF HE DOES NOT, how can I stop him from accidentally creating one? Thanks for any help!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Check for New Record (Access 2K)

    You can put code like this in the Before Insert event of the form used to enter data (you cannot do this in a table or query):
    <code>
    Private Sub Form_BeforeInsert(Cancel As Integer)
    Cancel = (MsgBox("Are you sure that you want to create a new record?", _
    vbQuestion + vbYesNo) = vbNo)
    End Sub
    </code>
    The message box will be displayed as soon as the user starts entering data in a new record.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check for New Record (Access 2K)

    Thanks, HansV!

Posting Permissions

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