VALIDAR ESPACIOS EN BLANCO
Publicado por ELTREMEN (4 intervenciones) el 27/09/2006 21:29:15
TENGO ESTE CODIGO, Y DESEO 2 COSAS, ESPERO Y ME PUEDAN AYUDAR,
LA 1ERA. QUE NO SE PUEDA DAR CLIC AL BOTON DE GUARDAR HASTA QUE ESTEN TODOS LOS CAMPOS LLENOS
2DA. Y LA SEGUNDA QUE AL MOMENTO DE CARGAR EL FORMULARIO ESTE DESABILITADO EL BOTON DE GUARDAR HASTA QUE EXISTAN DATOS
Private Sub Guardar_Click()
On Error GoTo Err_Guardar_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
MsgBox "Registro insertado", vbInformation, "OK"
Dim Control As Control
For Each Control In Me.Controls
If TypeOf Control Is TextBox Then
Control.Value = ""
End If
If TypeOf Control Is CheckBox Then
Control.Value = False
End If
If TypeOf Control Is ComboBox Then
Control.Value = ""
End If
Next
Exit_Guardar_Click:
Exit Sub
Err_Guardar_Click:
MsgBox Err.Description
Resume Exit_Guardar_Click
End Sub
LA 1ERA. QUE NO SE PUEDA DAR CLIC AL BOTON DE GUARDAR HASTA QUE ESTEN TODOS LOS CAMPOS LLENOS
2DA. Y LA SEGUNDA QUE AL MOMENTO DE CARGAR EL FORMULARIO ESTE DESABILITADO EL BOTON DE GUARDAR HASTA QUE EXISTAN DATOS
Private Sub Guardar_Click()
On Error GoTo Err_Guardar_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
MsgBox "Registro insertado", vbInformation, "OK"
Dim Control As Control
For Each Control In Me.Controls
If TypeOf Control Is TextBox Then
Control.Value = ""
End If
If TypeOf Control Is CheckBox Then
Control.Value = False
End If
If TypeOf Control Is ComboBox Then
Control.Value = ""
End If
Next
Exit_Guardar_Click:
Exit Sub
Err_Guardar_Click:
MsgBox Err.Description
Resume Exit_Guardar_Click
End Sub
Valora esta pregunta


0