Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
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.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,290
Default Error message creation

Sounds like you are on a UserForm, so...
Why not just set the value of the buttons and tell the user
what you have done?...

If ((optBill.Value + optWork.Value ) * (optCalendar.Value + optFiscal.Value)) = 0 Then
optBill.Value = True
optCalendar.Value = True
lblMsg.Caption = "I did it my way"
End If
--------

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Rich Mogy"
wrote in message
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.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Error message creation

Thanks----
"Jim Cone" wrote in message
...
Sounds like you are on a UserForm, so...
Why not just set the value of the buttons and tell the user
what you have done?...

If ((optBill.Value + optWork.Value ) * (optCalendar.Value +
optFiscal.Value)) = 0 Then
optBill.Value = True
optCalendar.Value = True
lblMsg.Caption = "I did it my way"
End If
--------

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Rich Mogy"
wrote in message
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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a creation date be added to a footer rogerl_uk Excel Discussion (Misc queries) 3 June 2nd 06 02:03 PM
Getting an external file creation date as data combustiblemoo Excel Discussion (Misc queries) 0 April 25th 06 01:37 PM
Changing date from =NOW() to Creation Date Kjell Forssen Excel Worksheet Functions 4 April 17th 06 06:18 PM
Move or copy sheet causing the creation of an htm file drlogarithm Excel Discussion (Misc queries) 0 November 7th 05 04:59 PM
automate creation of sheets in excel Daniel Excel Worksheet Functions 1 June 23rd 05 10:06 PM


All times are GMT +1. The time now is 05:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"