Also ich habe dank eines Kollegen das ganze jetzt so gelöst, es läuft auch fehlerfrei:
' Ausschluss von Nullwerten innerhalb der Textfelder
If txtAbfahrt = "" Then ' wenn Textfeldfeld Abfahrt leer bleibt
txtAbfahrt = txtAnfang ' wird der Wert aus dem Textfeld Anfang eingestzt
txtArbeitszeit.Visible = True ' Textfeld Arbeitszeit wird auf sichtbar gesetzt
anfang = FormatDateTime(txtAnfang, vbShortTime)
ende = FormatDateTime(txtEnde, vbShortTime)
pause = FormatDateTime(txtPause, vbShortTime)
abfahrt = FormatDateTime(txtAbfahrt, vbShortTime)
arbeitszeit = ende - anfang - pause
txtArbeitszeit = arbeitszeit ' Berechnung der Arbeitszeit
Else: txtAnfang = txtAbfahrt 'Ansonsten wird der Wert aus dem Textfeld Abfahrt in die Berechnung übernommen
txtArbeitszeit.Visible = True
anfang = FormatDateTime(txtAnfang, vbShortTime)
ende = FormatDateTime(txtEnde, vbShortTime)
pause = FormatDateTime(txtPause, vbShortTime)
abfahrt = FormatDateTime(txtAbfahrt, vbShortTime)
ankunft = FormatDateTime(txtAnkunft, vbShortTime)
arbeitszeit = ende - anfang - pause
txtArbeitszeit = arbeitszeit ' Berechnung der Arbeitszeit
End If
:OD