You could have three controls in frm Other, the textbox, txt Other and two command buttons, but Add Comment and but Cancel. Text Else Value = "False" End If End With Unload frm Other End Property Private Sub btn Add Comment_Click() Me. Hide End Sub Private Sub btn Cancel_Click() Unload Me End Sub' in frm Trade Sick Other Private Sub opt Other_Click() Dim ui Value As String Dim ui Button As Long Do ui Button = vb Cancel ui Value = Application. Value) If ui Value = "False" Then Msg Box "user canceled comment entry" Rem un-click opt Other Other.
Accommodating user error, validating that the user entered a non-null comment, putting the comment into the cell would all be handled in the first userform.
So, I rearranged the code a little, and made it more reusable by passing in the confirm message.
I also pass in the Validation Group (which I always use) so that only the proper set of validations is executed.
While designing the button, you can set its property Causes Validation="false" to avoid validation on button click event.
I do have master pages, user controls, and 3rd party controls on some of my pages but it would be strange if one of those decides to disable validation when used in conjuction with On Client Click and the confirm method. I think it's more user-friendly to make sure the form is valid before prompting them, otherwise you'll be asking them the same question multiple times as they fix their validation errors and resubmit the form.
I may make a simple page with one button and one text box and see if it still breaks. They'll be thinking to themselves "Yeah, I'm sure.".
Validation controls are called inside the page postback logic and as such should be getting called when you select yes with the confirm dialogue.
However, if you select no then the validation will not be called.
What I would do is have frm Other do nothing except receive the user entered text. Bold = True End With End If Next cloop Next rloop With Me.