Reputation: 509
I have an access form where I input data into them to be inserted into a table for storage, the code I use is
Private Sub cmd_go_Click()
Dim insertstring As String
insertstring = "INSERT INTO KWTable (KW, Source, Code) VALUES('" & text_key.Value & "','" & combo_source.Value & "','" & txt_code.Value & "');"
DoCmd.RunSQL insertstring
End Sub
And I was wondering if there was a code I could add to this so that once the data has been inserted the text box and the combo box would automatically clear?
Upvotes: 0
Views: 254
Reputation: 21047
Use the properties of the controls. Specifically, try setting the .Text
or .Value
properties to ""
:
txtTextBox.Text = ""
Or:
txtTextBox.Value = ""
Upvotes: 1