View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Rich Mogy Rich Mogy is offline
external usenet poster
 
Posts: 19
Default Error message creation

Hi All,
I have a udf with two radio buttons inside a frame -- another two radio
buttons inside another frame and then a text box for user input.

Initially the value of all four radio buttons is false, at the request of
the user.

I want to require the user to choose 1 of the 2 from each frame, if they
enter the txt box without doing so, I want to display a message and then
take them out of the text box.

This is my code so far. I know the if statement works because the message
displays, but the cursor is till in the txtbox.

Private Sub txtTkint_Enter()
If (optBill.Value = False And optWork.Value = False) Or (optCalendar.Value =
False And optFiscal.Value = False) Then
lblMsg.Caption = "You must choose at least one entry from " & Chr(34) &
"worked or billable" & _
Chr(34) & " OR " & Chr(34) & "Fiscal or Calendar Year" & Chr(34) & "
areas."
optWork.SetFocus
End If

End Sub


Any help would be appreciated.