I have a form with txtboxes into which data is input. I validate the data; something has to be entered into the txtboxes. After data is entered, either the tab-key or enter-key can be pressed to go to the next txtbox. Once the boxes are filled, the user can press a "calculate" cmdbutton to plug the data into an equation; or press the "reset" button to clear all txtboxes, returning to the first txtbox for new data input; or select the "exit" cmdbutton to close the form. If no data is entered into the field an form pops up indicating that data must be entered to proceed. My problem is that if the txtboxes are empty and I press the "close" cmdbutton, this error form pops up that I must enter data in the field. I have to use the form control box X to close the form. I have no idea where to start with this problem. Any suggestions are welcomed. The following is the routine to validate data in the txtboxes:
Private Sub txtrw_Validate(KeepFocus As Boolean)
If (Len(txtrw.Text) = 0) Then
KeepFocus = True
frmdataerror.Show
End If
End Sub
Private Sub txtrw_Validate(KeepFocus As Boolean)
If (Len(txtrw.Text) = 0) Then
KeepFocus = True
frmdataerror.Show
End If
End Sub