Code:
Private Sub TxtBxHrs1_Change()
If TxtBxHrs1.Text = "." Then
Me.TxtBxHrs.Text = CallChngeTxt(Me.TxtBxHrs1.text)
End If
End Sub
Function CallChngeTxt() As String
CallChngeTxt = "0.00"
End Function
For multiple textboxes use this function
Code:
Function CallChngeTxt() As String
CallChngeTxt = "0.00"
End Function
Private Sub TxtBxHrs1_Change()
If TxtBxHrs1.Text = "." Then
TxtBxHrs1.Text = CallChngeTxt(Me.TxtBxHrs1)
End If
End Sub
Private Sub TxtBxMin1_Change()
If TxtBxMin1.Text = "." Then
TxtBxMin1.Text = CallChngeTxt(Me.TxtBxMin1)
End If
End Sub
Private Sub TxtBxSec1_Change()
If TxtBxSec1.Text = "." Then
TxtBxSec1.Text = CallChngeTxt(Me.TxtBxSec1)
End If
End Sub
OR, this way
Code:
Private Sub CallChngeTxt(TB As Textbox)
TB.Text = "0.00"
End Sub
Private Sub TxtBxHrs1_Change()
If TxtBxHrs1.Text = "." Then
CallChngeTxt(Me.TxtBxHrs1)
End If
End Sub
Private Sub TxtBxMin1_Change()
If TxtBxMin1.Text = "." Then
CallChngeTxt(Me.TxtBxMin1)
End If
End Sub
Private Sub TxtBxSec1_Change()
If TxtBxSec1.Text = "." Then
CallChngeTxt(Me.TxtBxSec1)
End If
End Sub