View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
clara clara is offline
external usenet poster
 
Posts: 252
Default Passing a TextBox Object

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