Results 1 to 2 of 2

Thread: Tricky One?

  1. #1
    Join Date
    Jan 2012
    Posts
    3

    Red face Unanswered: Tricky One?

    Hi

    Ok I have built a simple database to track incoming work, I have managed to add a command button to one of my forms to allow me to print a report just showing that current form (worked fine.)

    Then I realised my auto numbers had been clocking up so i thought I would reset them and clear off the practice entries into the form. (I am a beginner)

    I deleted the primary key field (called ID) In my main table then added a new field back in and made it the primarykey and autonumber that has sorted autonumber issue but cant get blasted command button to print current record, have tried everything for about 4 hours.

    Is there anything I do or have i got to start a new database again to restore oringial links/relationships??????

    (out of my league)

    Cheers

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    presumably this is an Access problem?

    don't rely on the autonumber value being anything other than making a row unique. if the number must have significance outside the system then you probably have to roll your own numbering system.

    why?
    you don't know what interval there will be (most db's are one but that doesn't hold).
    there is nothing in the SQL spec that says an autonumber system MUST start at one in intervals of one its merely a quick method of ensuring that the each row has a unique piece of data.
    in a multi user system its possible to have rows hit the table and secure an autonumber value in a random sequence, there is no guarantee that the number will be allocated in the order you'd expect. say you had several people entering data at the smae time, the autonumber sequence int he Access world is normally allocated at the time the record is first saved not first edited / created.
    it possible that numbers may be missing (ferisntnace if the user creates a record but ultimately decides not to save it or if a record is deleted. so if your system requires a contiguous set of numbers then you MUST roll your own solution or be a lot cleverer in the way you use Access. by cleverer that means putting in some VBA behind the forms to cater for this juncture and handle accordingly something you cannot do if you sue the datasheet view and enter data directly into the tables
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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