E
Emma
Hello I have a button that clears the form so the user can enter a new
client's information. However I would like to have the ID come up
automatically to the next unique id in the list.
Here's some code I came up with however I have the SQL and Visual Basic
confused together, I would like some help coming up with code that works.
Private Sub newrcd_Click()
On Error GoTo Err_newrcd_Click
Dim TempID As Integer
DoCmd.GoToRecord , , acLast
'TempID = [Tbl Client Information].[ClientID]
'TempID = TempID + 1
DoCmd.GoToRecord , , acNewRec
'[Tbl Client Information].[ClientID] = TempID
Exit_newrcd_Click:
Exit Sub
Err_newrcd_Click:
MsgBox Err.Description
Resume Exit_newrcd_Click
End Sub
Thanks Emma
client's information. However I would like to have the ID come up
automatically to the next unique id in the list.
Here's some code I came up with however I have the SQL and Visual Basic
confused together, I would like some help coming up with code that works.
Private Sub newrcd_Click()
On Error GoTo Err_newrcd_Click
Dim TempID As Integer
DoCmd.GoToRecord , , acLast
'TempID = [Tbl Client Information].[ClientID]
'TempID = TempID + 1
DoCmd.GoToRecord , , acNewRec
'[Tbl Client Information].[ClientID] = TempID
Exit_newrcd_Click:
Exit Sub
Err_newrcd_Click:
MsgBox Err.Description
Resume Exit_newrcd_Click
End Sub
Thanks Emma