I have a subform based on a related table. I have a button to create a new record in the related table. I need a command or commands to clear the subform when the button for creating a new record is clicked.
Here is the code I have in the 'on click' event. Note the comment "clear the form," is where I want to put the command(s).
Private Sub cmdNewbtn_Click()
Dim tempnum As Long
Dim recnum As Long
DoCmd.RunCommand acCmdRecordsGoToLast
tempnum = TeamID
tempnum = tempnum + 1
'clear the form
DoCmd.RunCommand acCmdRecordsGoToNew
Me.TeamID = tempnum
End Sub