Comment box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a form with an option group called 'status' and a text box called
'comments'. I'm trying to contruct the form such that when the user selects
a specific button in the option group (option value 9), they must also write
something in the comments field.

Further, when this otion is selects, I'd like a message box to appear and
say"please add comments".

Thanks in advance!
 
You could use a message box, but it required an extra click. If you want to
do that to really get the user's attention, that is fine; however, if you
just want to display the message so the user doesn't have to do the extra
click, there is another way.

To avoid the message box, you could add a label control to your form with
the caption being the message you want to present, and set the visible
property to false.

Then, in the After Update event of your option group:

If Me.opgStatus = 9 Then
'Use this line if you use the label for the message
Me.lblMessage.Visible = True
'Use this line if you want a message box
MsgBox "Please Enter Comments"
Me.txtComments.SetFocus
End if

Then in the Got Focus of the text box:
Me.lblMessage.Visible = False
 
Back
Top