Automatic botton Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • margot
    New Member
    • Sep 2007
    • 48

    Automatic botton Access

    Hello, I have a question I have a form call Add record. The user needs to fill out several fields and then after pressing the Add button it will add the record to a table. I would like to create a textbox within the form so that when the user adds the record it would keep a number for that record. So basically the button needs to generate an automatic number for each new record. Do someone has an expample code for this case. I needly badly. THanks in advance!!!
  • Nathan H
    New Member
    • Nov 2007
    • 104

    #2
    Do you have an Autonumber field in the underlying table? This should automatically populate when you add a new record.

    Comment

    • margot
      New Member
      • Sep 2007
      • 48

      #3
      Originally posted by Nathan H
      Do you have an Autonumber field in the underlying table? This should automatically populate when you add a new record.
      Yes, but I want to bring that number to the actual form. How may I do that?

      Comment

      • Nathan H
        New Member
        • Nov 2007
        • 104

        #4
        Originally posted by margot
        Yes, but I want to bring that number to the actual form. How may I do that?
        In Design View on the form, you should be able to add a text box where the field source is the autonumber field in the table.

        Comment

        • missinglinq
          Recognized Expert Specialist
          • Nov 2006
          • 3533

          #5
          Here's a recent post from John W. Vinson, MVP, on this subject that you ought to read:

          “When using Autonumber, do be aware that there will be gaps in the numbering - any record that's deleted will leave a gap; hitting <Esc> after starting a record will leave a gap; adding records using an Append query may leave a gap, often a huge one; replicating the database will make your invoice numbers random.

          In short... it's best NOT to use Autonumbers for human consumption, and particularly not for consumption by accountants and auditors. Invoice sequences like 319, 321, 322, 385, 386, 221841246, -1083225152 make such people get very nervous.”

          If you need consistently consecutive numbers, you need to generate your own incrementing numbers.

          Linq ;0)>

          Comment

          Working...