I have a form that is getting it's record number from a closed table, then adding 1 to it.
Now I am trying to increment that table by 1 so I get a new number the next time.
I have been fighting with this for a couple of hours.
I have gotten several errors with various different tries-
The pauses are so I can watch it happen (or, more correctly, not happen.
It will open the table, add a new record and then puke..i can't get the auto number to happen- it dies right there with the record number still at 'New' and will not move to the second field, causing the number to happen.
Here is what WONT work;
Private Sub Command19_Click()
DoCmd.OpenTable "CustomPID"
Pause (1)
DoCmd.GoToRecord , , acNewRec
Pause (1)
Tables!CustomPID!ID.SetFocus
Pause (1)
Tables!CustomPID![udder].SetFocus
Pause (1)
DoCmd.RunCommand acCmdSaveRecord
'DoCmd.NewRecord
'DoCmd.Save
DoCmd.Close
End Sub
Thanks again,
Dave
Now I am trying to increment that table by 1 so I get a new number the next time.
I have been fighting with this for a couple of hours.
I have gotten several errors with various different tries-
The pauses are so I can watch it happen (or, more correctly, not happen.
It will open the table, add a new record and then puke..i can't get the auto number to happen- it dies right there with the record number still at 'New' and will not move to the second field, causing the number to happen.
Here is what WONT work;
Private Sub Command19_Click()
DoCmd.OpenTable "CustomPID"
Pause (1)
DoCmd.GoToRecord , , acNewRec
Pause (1)
Tables!CustomPID!ID.SetFocus
Pause (1)
Tables!CustomPID![udder].SetFocus
Pause (1)
DoCmd.RunCommand acCmdSaveRecord
'DoCmd.NewRecord
'DoCmd.Save
DoCmd.Close
End Sub
Thanks again,
Dave