Passing a TextBox Object

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top