ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,596
- Office Version
- 2007
- Platform
- Windows
Morning,
After i submit my form i would like to the have the field contents cleared so i can then start my second data input etc.
My code in use is supplied below.
thanks
After i submit my form i would like to the have the field contents cleared so i can then start my second data input etc.
My code in use is supplied below.
Code:
Private Sub CommandButton1_Click()
With Sheets("DATABASE")
.Range("A6").Value = Me.TextBox1.Text
.Range("B6").Value = Me.ComboBox1.Text
.Range("C6").Value = Me.ComboBox2.Text
.Range("D6").Value = Me.ComboBox3.Text
.Range("E6").Value = Me.ComboBox4.Text
.Range("F6").Value = Me.ComboBox5.Text
.Range("G6").Value = Me.ComboBox6.Text
.Range("H6").Value = Me.ComboBox7.Text
.Range("I6").Value = Me.ComboBox8.Text
.Range("J6").Value = Me.ComboBox9.Text
.Range("K6").Value = Me.ComboBox10.Text
.Range("L6").Value = Me.ComboBox11.Text
.Range("M6").Value = Me.TextBox2.Text
.Range("N6").Value = Me.ComboBox12.Text
.Range("O6").Value = Me.TextBox3.Text
.Range("P6").Value = Me.TextBox4.Text
.Range("Q6").Value = Me.TextBox5.Text
End With
.Me.TextBox.Text = ""
.Me.ComboBox1.Text = ""
.Me.ComboBox2.Text = ""
.Me.ComboBox3.Text = ""
.Me.ComboBox4.Text = ""
.Me.ComboBox5.Text = ""
.Me.ComboBox6.Text = ""
.Me.ComboBox7.Text = ""
.Me.ComboBox8.Text = ""
.Me.ComboBox9.Text = ""
.Me.ComboBox10.Text = ""
.Me.ComboBox11.Text = ""
.Me.TextBox2.Text = ""
.Me.ComboBox12.Text = ""
.Me.TextBox3.Text = ""
.Me.TextBox4.Text = ""
.Me.TextBox5.Text = ""
TextBox2.Value = Now
TextBox2 = Format(TextBox2.Value, "dd/mm/yyyy")
TextBox1.SetFocus
End Sub
thanks