DTPicker übernimmt nicht das Datum
27.11.2018 17:19:27
Magda
ich habe das Problem das mir leider aus der UserForm mit dem DTPicker nicht das Datum übernommen wird in die Email oder in die Excel Liste es zeigt immer 00:00:00 an.
Ich wäre sehr Dankbar für Hilfe, ich komme hier einfach nicht weiter.
Hier mein Code:
Private Sub CommandButton1_Click()
If TextBox2 = "" Then
MsgBox "Bitte ---- eintragen!"
TextBox2.SetFocus
Exit Sub
Exit Sub
End If
Unload Me
Dim APP_OUTLOOK As Object
Dim MESSAGE As Object
Set APP_OUTLOOK = CreateObject("Outlook.Application")
Set MESSAGE = APP_OUTLOOK.CreateItem(0)
With MESSAGE
.To = "XXXXXX"
.Subject = "XXX" & " " & TextBox5 & " " & TextBox2 & " " & TextBox6
.Body = "XXXX" & " = " & ComboBox1 & vbCrLf & " Auftrag" & " = " & TextBox1 & vbCrLf & _
_
_
"Maschinen" & _
" = " & ComboBox2 & vbCrLf & " *** " & " = " & TextBox2 & vbCrLf & "XXX" & " = " & _
_
_
TextBox3 & vbCrLf & "XXX" & " = " _
& DTPicker1 & vbCrLf & "XXX" & " = " & DTPicker1 & vbCrLf & "XXXX" & " = " & TextBox4
.Display
End With
Dim Lngzeile As Long
Dim Boxen As String
With Worksheets(1)
Lngzeile = Cells(.Rows.Count, 3).End(xlUp).Row + 1
Boxen = "xxxx " & ComboBox1 & ",Auftrag: " & TextBox1 & ",xxxx: " & ComboBox2 & "xxx: " & _
_
_
_
TextBox2 & ",xxx: " & TextBox3 & ",Lieferdatum: " & DTPicker1 & ",xxx: " & DTPicker2 & ", _
_
_
xxx: " & TextBox4
Cells(Lngzeile, 4) = Boxen
Cells(Lngzeile, 3) = "Banf"
Cells(Lngzeile, 5) = Date
End With
Unload Banf
Set APP_OUTLOOK = Nothing
Set MESSAGE = Nothing
Private Sub UserForm_Initialize()
DTPicker1.Value = Date
DTPicker2.Value = Date
End Sub