D
dkuntz
Guest
I have a Form that will primarily be used as a Data Entry Form. I want to have a "Submit" button that can be clicked to send the data that they entered to the database and clear the Form. As it is now the only way all of the data is cleared and sent to the databse is if they tab through the whole Form. The code below doesn't seem to be doing the trick.
Any help would be appreciated!!
Private Sub cmdSubmit_Click()
Dim ctl As Control
Dim tbx As TextBox
On Error GoTo Err_cmdSubmit_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
For Each ctl In Me.Controls
If ctl Is tbx Then
tbx.Text = ""
End If
Next ctl
Exit_cmdSubmit_Click:
Exit Sub
Err_cmdSubmit_Click:
MsgBox Err.Description
Resume Exit_cmdSubmit_Click
End Sub
Any help would be appreciated!!
Private Sub cmdSubmit_Click()
Dim ctl As Control
Dim tbx As TextBox
On Error GoTo Err_cmdSubmit_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
For Each ctl In Me.Controls
If ctl Is tbx Then
tbx.Text = ""
End If
Next ctl
Exit_cmdSubmit_Click:
Exit Sub
Err_cmdSubmit_Click:
MsgBox Err.Description
Resume Exit_cmdSubmit_Click
End Sub