englishkid19
Board Regular
- Joined
- Nov 14, 2012
- Messages
- 89
Hi All, Access NEWBIE here
I have a question regarding how auto-incremented fields are handled in access :
I have a simple Userform built which inserts data into a table ;
It works fine but when it does throw an error the Table seems to incur gaps in the auto incremented field. Like the errored rows were executed but no inserted. Its really not an issue as it traps the errors and does not Add them to the table but when i view the Table it looks odd as the auto incremeneted column goes from like 1,2,3,6,7,8 like the value for 4 & 5 were errors it caught ?
Am i explainign this well at all?
I have a question regarding how auto-incremented fields are handled in access :
I have a simple Userform built which inserts data into a table ;
Code:
Private Sub Add_Click()
On Error GoTo ErrorHandler1
'Set warnings = True
CurrentDb.Execute "INSERT INTO AGMInput(ResourceBase,DateAdded,VOR)" & _
"VALUES ('" & Me.ResourceBase & "','" & Me.DateAdded & "', '" & Me.VOR & "')", dbFailOnError
ExitRoutine:
Exit Sub
ErrorHandler1:
MsgBox "Export Failed likely due to data already being added for the current Resource Base and date", , "DataValidationWarning"
End Sub
It works fine but when it does throw an error the Table seems to incur gaps in the auto incremented field. Like the errored rows were executed but no inserted. Its really not an issue as it traps the errors and does not Add them to the table but when i view the Table it looks odd as the auto incremeneted column goes from like 1,2,3,6,7,8 like the value for 4 & 5 were errors it caught ?
Am i explainign this well at all?