Label Caption Just Wont Work on UserForm

  • Thread starter Thread starter K
  • Start date Start date
K

K

Hello

I just can't figure this out.
I am using Label Caption to deliver messages on a Userform (see below)

When I step through the procedure the Caption works. When I run it does
not.

The ValidateDate Sub uses LabelMessage.Caption (different message) , and
this works fine when I run it.

When I move
LabelMessage.Caption = "Testing Date. Please Wait"
to within the VaildateDate Sub the same problem described above occurs

What am I missing
Thanks for any suggestions


Private Sub lblStartDate_Click()
Dim TCTestDate As String
TCTestDate = txtStartDate.Value
LabelMessage.Caption = "Testing Date. Please Wait"

Call ValidateDate( )
End Sub
 
There is nothing to stop the code from executing.

I think you want a Userform1.show somewhere in there (after you initialize
it)

Call ValidateDate( )
......test for valid date here----
If TestDate = False Then
LabelMessage.Caption = "Invalid " & WhichDate & _
" Enter new date & Click Date Label"

Load UserForm1

With Userform1
If WhichDate = "StopDate" Then

.txtStopDate.Value = ""
.txtStopDate.SetFocus
.txtStopDate.SelStart = 0
.txtStopDate.SelLength = Len(txtStopDate.Text)

ElseIf WhichDate = "StartDate" Then

.txtStartDate.Value = ""
.txtStartDate.SetFocus
.txtStartDate.SelStart = 0
.txtStartDate.SelLength = Len(txtStartDate.Text)

End If
.show
End With
End If
end sub

perhaps. Don't know where txtStartDate and txtStopDate are located. Assume
Userform1.
 
Thank you again for your suggestion.
I get a " Userform already open. Cannot show Userform modally " error message
I have tried placing Userform.Show / DeEvents at various places,
but I am stumped.

All I am trying to do is validate two dates in two different userform text boxes
, and get the User to resubmit them if they're invalid

Appreciate any other ideas from the Newsgroup.Thanks
 
Back
Top