Passing a TextBox Object

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

txtCorActDue1 is one of TextBox on a form and FillDateIn is a procedure used
to fill date in the textbox when enter event happens, but when FillDateIn is
call like the following, there is alway a type mismatch error. I guess
txtCorActDue1 default value is text but how can I designate an object instead
of its default value passed?

Clara

Private Sub txtCorActDue1_Enter()
FillDateIn txtCorActDue1
End Sub


Private Sub FillDateIn(txBox As TextBox)
txBox.text = Year(FormatDateTime(14 + Now(), vbShortDate)) & "/" & _
Month(FormatDateTime(14 + Now(), vbShortDate)) & "/" & _
Day(FormatDateTime(14 + Now(), vbShortDate))
End Sub
 
Back
Top