I have working on forms, after i filled all the fields and Click on Save button, all fields have been saved but the text fields was not empty, all entered text still present, How do removed those text after hit on the save button
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Go to a new record:
DoCmd.GoToRecord , , acNewRec
回答2:
May be you would like to add the following in the click on save button event before "End Sub"
Me.TextboxName.Value = Null
回答3:
Try this routine linked to a button you want to click to clear all textboxes in an unbound form:
Private Sub CleanAllFieldsButton_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then ctl = Null
Next
Set ctl = Nothing
End Sub
回答4:
Private Sub Command47_Click()
On Error Resume Next
Me.Dirty = False 'Attempt to save the record
If Err.Number = 0 Then
'Only enter a new record, leaving other newly-added record accessible
DoCmd.GoToRecord , , acNewRec
Else MsgBox Err.DESCRIPTION, vbCritical, "Error"
End If
End Sub
Try this is in your save records click event.