I have a form with tab controls (TabControl1). There is a datagridview1 above it and when a row is clicked, it populates textboxes in the TabPage1 child. I have a TextBoxID that contains the Primary Key. I would like to validate against that using the validating class to prevent a user from clicking or changing the focus of TabPage1 if TextBoxID.Text=""
I tried several renditions of something like this...
How can I achieve this without having to continue checking other tab enter events for this field being empty?Code:Private Sub TabControl1_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TabControl1.Validating If TextBoxID.Text = "" Then MsgBox("Field Data Needed For Other Tabs!") e.Cancel = True End If End Sub




Reply With Quote
