Interviewer And Interviewee Guide

Microsoft Access Developer Interview Question:

Suppose a table that has a field formatted as autonumber somehow has resulted in duplicate numbers. How can this happen?

Submitted by: Muhammad
When an autonumber format is selected, Access will assign a number to each new record that is entered to the table. The initial number default starts at 1, but utilizing the following steps can change this default. Follow the example 1. Create a table of addresses using field names ID, Fname, Lname, Address1, Address2, City, State, and Zip. Be sure to format ID as autonumber and all other fields as Text (or some other format that will accept your data. Save the table as TableA. 2. Add records to TableA. Watch Access automatically assign an incremental number for the ID field starting at 1. 3. Now create a second table using the same fields as above. This time format the ID field as number. Save this table as TableB 4. Add records to the table. This time you will have to assign an ID to each record. Start the first record with ID = 100, and increment from there up. 5. Create an Append query to populate the records of TableB to TableA. As long as you named the fields the same between the two tables, Access will automatically link the field names when you choose Append Query. See the QBE grid. Run the query. 6. Now go back to TableA and add another record. The field ID formatted as autonumber now starts at the next highest value of all the records within TableA. This is the only known way to defeat the autonumber procedure. To answer the question above, add records to TableB duplicating the ID numbers from TableA. Re-run the append query, then view TableA again. The ID field will be duplicated.
Submitted by: Muhammad

Read Online Microsoft Access Developer Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.