Postada em 27/10/2003 por Los Zeus® Private Sub Command1_Click() If Vazio(Me) = True Then Msgbox "Campo vazio" End If End Sub
Function Vazio(Formulario as Form) As Boolean Dim Controle As Control On Error Resume Next Vazio = False For Each Controle In Formulario.Controls If Trim(Controle.Text)="" then If Err.Number = 0 then Vazio = True Controle.BackColor = &HFFC0FF End If Err.Clear Else If Controle.BackColor = &HFFC0FF then Controle.BackColor = QBColor(15) End If End If Next Controle End Function