Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Blank Autonumbered Record (A2K)

    Scenario:

    User opens up input form on a blank record.

    This record is identified with an Autonumber Field

    If no input whatsoever is applied to this record and the form is exitted,

    a new, blank autonumbered record is created on exit.

    Not good.

    Is there a quick and easy way of "killing" this record so that a "false" record is not created.

    As always, thanks in advance for any help with this.
    Cheers,
    Andy

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

    Re: Blank Autonumbered Record (A2K)

    Normally, the new autonumber value is assigned when the user starts entering data. If the user exits without having entered anything, no record will be saved.
    So I suspect that you use code to set the value of one or more fields before the user starts entering data. You should avoid that

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Blank Autonumbered Record (A2K)

    Thanks Hans.

    The search for the phantom data begins!
    Cheers,
    Andy

  4. #4
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Blank Autonumbered Record (A2K)

    Hans,

    Guess what happens when you do the following:

    Private Sub Form_Load()
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    DoCmd.GoToRecord , , acNewRec
    Me.[03 RA_No] = Null
    Me.txt_UserId.SetFocus
    End Sub

    Stupid Null!
    Cheers,
    Andy

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

    Re: Blank Autonumbered Record (A2K)

    Yep, it actually creates a new record and assigns a new AutoNumber value...

Posting Permissions

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