validar combobox
Publicado por alejandro (11 intervenciones) el 04/01/2007 16:24:27
Hola miren tengo en un formulario para modificar categorias. Para eso uso un combobox para seleccionar el numero de categoria, luego, al seleecionar un numero del combobox, se me despliega en los textbox la informacion correspondiente a ese numero de categoria. Aqui hago las modificaciones que quiero y guardo. Hasta aqui todo bien PERO EL PROBLEMA ES CUANDO APRIETO GUARDAR Y NO SELECCIONO NINGUN ELEMENTO DEL COMBOBOX ME SALE UN ERROR. TRATE DE HACER ESTO PERO NO ME FUNCIONA:
Private Sub Command1_Click()
.
.
.
.
If Not puntero_modcategorias.EOF And Not puntero_modcategorias.BOF And texto(1).Text <> "" Then
consulta = "UPDATE categorias SET nombrecategoria ='" & texto(1).Text & "' , descripcion = '" & texto(2).Text & "' WHERE ncategoria = '" & texto(3).Text & "' "
pun.Execute (consulta)
ElseIf Not puntero_modcategorias.EOF And Not puntero_modcategorias.BOF And texto(1).Text = "" Then
MsgBox " ingrese nombre de categoria "
ElseIf puntero_modcategorias.EOF And puntero_modcategorias.BOF And texto(1).Text <> "" Then
MsgBox " ingrese numero de categoria"
ElseIf puntero_modcategorias.EOF And puntero_modcategorias.BOF And texto(1).Text = "" Then
MsgBox " ingrese nombre y numero de categoria "
End If
.
.
.
NO SE SI ESTARA BIEN EL USO DEL RECORDSET PUNTERO_MODCATEGORIAS Q
Private Sub Command1_Click()
.
.
.
.
If Not puntero_modcategorias.EOF And Not puntero_modcategorias.BOF And texto(1).Text <> "" Then
consulta = "UPDATE categorias SET nombrecategoria ='" & texto(1).Text & "' , descripcion = '" & texto(2).Text & "' WHERE ncategoria = '" & texto(3).Text & "' "
pun.Execute (consulta)
ElseIf Not puntero_modcategorias.EOF And Not puntero_modcategorias.BOF And texto(1).Text = "" Then
MsgBox " ingrese nombre de categoria "
ElseIf puntero_modcategorias.EOF And puntero_modcategorias.BOF And texto(1).Text <> "" Then
MsgBox " ingrese numero de categoria"
ElseIf puntero_modcategorias.EOF And puntero_modcategorias.BOF And texto(1).Text = "" Then
MsgBox " ingrese nombre y numero de categoria "
End If
.
.
.
NO SE SI ESTARA BIEN EL USO DEL RECORDSET PUNTERO_MODCATEGORIAS Q
Valora esta pregunta


0