问题
I keep trying to create a new record expecting a new blank form to show up but all of the info from the previous form shows up.
I need a blank form to enter data but i also need to save all of my previous forms. Overall, I want to keep adding onto my records. But somehow it won't let me.
回答1:
If I'm understanding correctly you open a form but it is showing the data you previously entered? if it is that you want avoid seeing the previous data and just have a blank for for entry that you should set the form properties Data Entry
to Yes
回答2:
Depending on whether or not you have a bound form, Kefash' answer could work. If you have an unbound form however, it will not.
If you do have an unbound form, the simplest way is to just loop through all the controls and empty them. For example:
Private Sub save_Click()
Dim ctl As Control
For Each ctl In Me.Controls
Select Case ctl.ControlType
Case acListBox
If Len(ctl.ControlSource) = 0 Then
ctl.Value = Null
End If
Case acCheckBox
ctl.Value = 0
Case acTextBox
ctl.value = ""
End Select
Next
End Sub
来源:https://stackoverflow.com/questions/24493903/how-to-create-a-new-blank-record-without-it-showing-the-previous-data-from-the-p