you can try use the Validate event for each textbox, and need a boolean variable to enable the command
Set the TabStop property for the textboxes to True and the TabIndex property:
In every form, I put in a sub called AdjustControls.
Private Sub AdjustControls()
I call this from every event that might affect other controls.
Call this from each Text_Changed Event
Private Sub AdjustControls()
cmd.Enabled = (Len(txt1.Text) > 0 and _
Len(txt2,text) > 0 and _
Len(txt3.Text) > 0)
End Sub
[tt]
Private Sub cmdDone_Click()
Dim ctl as Control
For Each ctl In Controls
If TypeOf ctl Is TextBox Then
If ctl.Text = "" Then
MsgBox "All fields must be entered."
Exit Sub
End If
Next ctl
[/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.