30.04.2013 Views

1. Visual Basic - Curso completo teoria y practica

1. Visual Basic - Curso completo teoria y practica

1. Visual Basic - Curso completo teoria y practica

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Command1<br />

Command2<br />

Command3<br />

Command4<br />

Nombre CmdAceptar<br />

Caption &Aceptar<br />

Nombre CmdGrabar<br />

Caption &Grabar<br />

Nombre CmdNuevo<br />

Caption &Nuevo<br />

Nombre CmdCerrar<br />

Caption &Cerrar<br />

Una vez establecidas las propiedades, proceda a ingresar<br />

el siguiente código:<br />

Private Sub Form_Load()<br />

CmdAceptar.Enabled = True<br />

CmdGrabar.Enabled = False<br />

CmdNuevo.Enabled = False<br />

End Sub<br />

Private Sub CmdAceptar_Click()<br />

Dim Rs As New ADODB.Recordset<br />

Set Rs = Cn.Execute(“Select CurNombre, ” & _<br />

“CurVacantes, CurProfe From <strong>Curso</strong> ” & _<br />

“Where CurCodigo = '” & TxtCurCodigo & “'”)<br />

If (Rs.EOF And Rs.BOF) Then<br />

MsgBox “No existe ningún curso con este código”<br />

TxtCurCodigo.SetFocus<br />

Pág. 339

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!