nicka2511
02-04-2015, 07:50 AM
I have an excel form in which I am using a date picker (DTPicker1) and it is not defaulting to today's day. I would like to show today's date, would anyone have any idea how to make that happen.
I have attached a copy of the form and the coding.
Private Sub CommandButton1_Click()
Dim LastRow As Object
Set LastRow = Sheet8.Range("a65536").End(xlUp)
LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = DTPicker1.Value
LastRow.Offset(1, 2).Value = DTPicker1.Month
LastRow.Offset(1, 3).Value = combo_IssueType.Text
MsgBox "One record written to Pivot Data"
response = MsgBox("Do you want to enter another record?", _
vbYesNo)
If response = vbYes Then
TextBox1.Text = ""
'DTPicker1.Value = .Value
combo_IssueType.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
End Sub
12806
I have attached a copy of the form and the coding.
Private Sub CommandButton1_Click()
Dim LastRow As Object
Set LastRow = Sheet8.Range("a65536").End(xlUp)
LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = DTPicker1.Value
LastRow.Offset(1, 2).Value = DTPicker1.Month
LastRow.Offset(1, 3).Value = combo_IssueType.Text
MsgBox "One record written to Pivot Data"
response = MsgBox("Do you want to enter another record?", _
vbYesNo)
If response = vbYes Then
TextBox1.Text = ""
'DTPicker1.Value = .Value
combo_IssueType.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
End Sub
12806