Consulta también:
- Vb6 setfocus
- Restaurar iphone de fábrica con botones - Guide
- Resetear epson l380 con botones - Guide
- Cheats pokemon rojo fuego visual boy advance - Guide
- Visual foxpro - Guide
- Pokemon rojo fuego visual boy advance - Programas - Rol
10 respuestas
Retro78
Mensajes enviados
15
Fecha de inscripción
viernes, 4 de abril de 2008
Estatus
Miembro
Última intervención
jueves, 30 de octubre de 2008
31
30 oct 2008 a las 17:29
30 oct 2008 a las 17:29
Aqui te adjunto un link muy explicativo !
https://www.lawebdelprogramador.com/codigo/Visual-Basic/1243-Crear-controles-en-tiempo-de-ejecucion.html
Sino aca te adjunto un tutorial:
https://www.emagister.com.mx/s/controles_visual_basic-327142.htm
Suerte!
https://www.lawebdelprogramador.com/codigo/Visual-Basic/1243-Crear-controles-en-tiempo-de-ejecucion.html
Sino aca te adjunto un tutorial:
https://www.emagister.com.mx/s/controles_visual_basic-327142.htm
Suerte!
bueno en codigo para guardar y eliminar es facil solo escribes
dataenviroment con el numero que es + .Rscommand con el numero de comando+ . update para guardar o .delete para eliminar
dataenviroment con el numero que es + .Rscommand con el numero de comando+ . update para guardar o .delete para eliminar
Antes de poder responderte debes especificar de que tipo es tu base de datos osea por ejemplo si usas sql , acces , etcs ; esto es debido a que hay muchas formas diferentes de hacer que estos botones funcionen pero depende de las herramientas en uso .
Si tan solo buscaras en internet encontrarias respuestas
Aqui adjunto unos enlaces para que busques
http://www.vb-mundo.com/
http://www.elguille.info/
https://www.recursosvisualbasic.com.ar/
Aqui adjunto unos enlaces para que busques
http://www.vb-mundo.com/
http://www.elguille.info/
https://www.recursosvisualbasic.com.ar/
no se si alguien me pueda ayudar, estoy haciendo un programa de boleta de pago que debe vincularse con acces y debo agregar un boton de "mostrar" que me lleve a la tabla de acces.....
espero te sirva:
Mi ejemplo es para agregar, modificar, dar de alta libros, y cancelar las operaciones anteriores regresandote al menu.
Function VALIDAR() As Boolean
If REGISTRO.Text = "" Or ASIGNATURA.Text = "" Or TITULO.Text = "" Or AUTOR.Text = "" Or EDITORIAL.Text = "" Or BIBLIOTECA.Text = "" Or OBSERVACIONES.Text = "" Then
VALIDAR = True
MsgBox "Debe Insertar el o los Dato(s) Faltante(s)", vbInformation, "ok"
MsgBox "Este recurso no ha sido Actualizado ni Guardado", vbInformation, "ok"
Adodc1.Recordset.CancelUpdate
ALTA.Visible = False
AGREGAR.Visible = True
CANCELAR.Visible = True
ACTUALIZAR.Visible = True
AGREGAR.Enabled = True
ACTUALIZAR.Enabled = True
NPBG.Enabled = False
REGISTRO.Enabled = False
ASIGNATURA.Enabled = False
TITULO.Enabled = False
AUTOR.Enabled = False
EDITORIAL.Enabled = False
BIBLIOTECA.Enabled = False
OBSERVACIONES.Enabled = False
ALTA.Enabled = False
AGREGAR.SetFocus
End If
End Function
Function limpiar()
NPBG.Text = ""
REGISTRO.Text = ""
ASIGNATURA.Text = ""
TITULO.Text = ""
AUTOR.Text = ""
EDITORIAL.Text = ""
BIBLIOTECA.Text = ""
OBSERVACIONES.Text = ""
End Function
Private Sub ACTUALIZAR_Click()
ALTA.Visible = True
AGREGAR.Visible = False
CANCELAR.Visible = False
ACTUALIZAR.Visible = False
ALTA.Enabled = True
AGREGAR.Enabled = False
ACTUALIZAR.Enabled = False
NPBG.Enabled = False
REGISTRO.Enabled = True
ASIGNATURA.Enabled = True
TITULO.Enabled = True
AUTOR.Enabled = True
EDITORIAL.Enabled = True
BIBLIOTECA.Enabled = True
OBSERVACIONES.Enabled = True
End Sub
Private Sub AGREGAR_Click()
ALTA.Visible = True
AGREGAR.Visible = False
CANCELAR.Visible = False
ACTUALIZAR.Visible = False
ALTA.Enabled = True
ACTUALIZAR.Enabled = False
AGREGAR.Enabled = False
NPBG.Enabled = False
REGISTRO.Enabled = True
ASIGNATURA.Enabled = True
TITULO.Enabled = True
AUTOR.Enabled = True
EDITORIAL.Enabled = True
BIBLIOTECA.Enabled = True
OBSERVACIONES.Enabled = True
Adodc1.Recordset.AddNew
REGISTRO.SetFocus
End Sub
Private Sub ALTA_Click()
If VALIDAR = True Then
Exit Sub
End If
ALTA.Visible = False
AGREGAR.Visible = True
CANCELAR.Visible = True
ACTUALIZAR.Visible = True
NPBG.Enabled = False
REGISTRO.Enabled = False
ASIGNATURA.Enabled = False
TITULO.Enabled = False
AUTOR.Enabled = False
EDITORIAL.Enabled = False
BIBLIOTECA.Enabled = False
OBSERVACIONES.Enabled = False
ALTA.Enabled = False
ACTUALIZAR.Enabled = True
AGREGAR.Enabled = True
CANCELAR.Enabled = True
Adodc1.Recordset.Update
MsgBox "Recurso Actualizado y Guardado Correctamente ", vbInformation, "ok"
End Sub
Private Sub ANULACIÓN_Click()
NPBG.Enabled = False
REGISTRO.Enabled = False
ASIGNATURA.Enabled = False
TITULO.Enabled = False
AUTOR.Enabled = False
EDITORIAL.Enabled = False
BIBLIOTECA.Enabled = False
OBSERVACIONES.Enabled = False
AGREGAR.Enabled = True
ALTA.Enabled = False
ACTUALIZAR.Enabled = True
ANULACIÓN.Enabled = False
CANCELAR.Enabled = True
Adodc1.Recordset.CancelUpdate
End Sub
Private Sub ASIGNATURA_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TITULO.SetFocus
End If
End Sub
Private Sub AUTOR_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
EDITORIAL.SetFocus
End If
End Sub
Private Sub BIBLIOTECA_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
OBSERVACIONES.SetFocus
End If
End Sub
Private Sub CANCELAR_Click()
Form3.Visible = True
Form4.Visible = False
NPBG.Enabled = False
REGISTRO.Enabled = False
ASIGNATURA.Enabled = False
TITULO.Enabled = False
AUTOR.Enabled = False
EDITORIAL.Enabled = False
BIBLIOTECA.Enabled = False
OBSERVACIONES.Enabled = False
ALTA.Enabled = False
ACTUALIZAR.Enabled = True
CANCELAR.Enabled = True
AGREGAR.Enabled = True
End Sub
Private Sub EDITORIAL_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
BIBLIOTECA.SetFocus
End If
End Sub
Private Sub Form_Load()
Call Conectar
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 0 Then Cancel = 1
End Sub
Private Sub OBSERVACIONES_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
ALTA.SetFocus
End If
End Sub
Private Sub REGISTRO_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
ASIGNATURA.SetFocus
End If
End Sub
Private Sub Timer1_Timer()
Dim fecha As Variant
fecha = Date
Label4.Caption = Str(fecha)
End Sub
Private Sub TITULO_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
AUTOR.SetFocus
End If
End Sub
Mi ejemplo es para agregar, modificar, dar de alta libros, y cancelar las operaciones anteriores regresandote al menu.
Function VALIDAR() As Boolean
If REGISTRO.Text = "" Or ASIGNATURA.Text = "" Or TITULO.Text = "" Or AUTOR.Text = "" Or EDITORIAL.Text = "" Or BIBLIOTECA.Text = "" Or OBSERVACIONES.Text = "" Then
VALIDAR = True
MsgBox "Debe Insertar el o los Dato(s) Faltante(s)", vbInformation, "ok"
MsgBox "Este recurso no ha sido Actualizado ni Guardado", vbInformation, "ok"
Adodc1.Recordset.CancelUpdate
ALTA.Visible = False
AGREGAR.Visible = True
CANCELAR.Visible = True
ACTUALIZAR.Visible = True
AGREGAR.Enabled = True
ACTUALIZAR.Enabled = True
NPBG.Enabled = False
REGISTRO.Enabled = False
ASIGNATURA.Enabled = False
TITULO.Enabled = False
AUTOR.Enabled = False
EDITORIAL.Enabled = False
BIBLIOTECA.Enabled = False
OBSERVACIONES.Enabled = False
ALTA.Enabled = False
AGREGAR.SetFocus
End If
End Function
Function limpiar()
NPBG.Text = ""
REGISTRO.Text = ""
ASIGNATURA.Text = ""
TITULO.Text = ""
AUTOR.Text = ""
EDITORIAL.Text = ""
BIBLIOTECA.Text = ""
OBSERVACIONES.Text = ""
End Function
Private Sub ACTUALIZAR_Click()
ALTA.Visible = True
AGREGAR.Visible = False
CANCELAR.Visible = False
ACTUALIZAR.Visible = False
ALTA.Enabled = True
AGREGAR.Enabled = False
ACTUALIZAR.Enabled = False
NPBG.Enabled = False
REGISTRO.Enabled = True
ASIGNATURA.Enabled = True
TITULO.Enabled = True
AUTOR.Enabled = True
EDITORIAL.Enabled = True
BIBLIOTECA.Enabled = True
OBSERVACIONES.Enabled = True
End Sub
Private Sub AGREGAR_Click()
ALTA.Visible = True
AGREGAR.Visible = False
CANCELAR.Visible = False
ACTUALIZAR.Visible = False
ALTA.Enabled = True
ACTUALIZAR.Enabled = False
AGREGAR.Enabled = False
NPBG.Enabled = False
REGISTRO.Enabled = True
ASIGNATURA.Enabled = True
TITULO.Enabled = True
AUTOR.Enabled = True
EDITORIAL.Enabled = True
BIBLIOTECA.Enabled = True
OBSERVACIONES.Enabled = True
Adodc1.Recordset.AddNew
REGISTRO.SetFocus
End Sub
Private Sub ALTA_Click()
If VALIDAR = True Then
Exit Sub
End If
ALTA.Visible = False
AGREGAR.Visible = True
CANCELAR.Visible = True
ACTUALIZAR.Visible = True
NPBG.Enabled = False
REGISTRO.Enabled = False
ASIGNATURA.Enabled = False
TITULO.Enabled = False
AUTOR.Enabled = False
EDITORIAL.Enabled = False
BIBLIOTECA.Enabled = False
OBSERVACIONES.Enabled = False
ALTA.Enabled = False
ACTUALIZAR.Enabled = True
AGREGAR.Enabled = True
CANCELAR.Enabled = True
Adodc1.Recordset.Update
MsgBox "Recurso Actualizado y Guardado Correctamente ", vbInformation, "ok"
End Sub
Private Sub ANULACIÓN_Click()
NPBG.Enabled = False
REGISTRO.Enabled = False
ASIGNATURA.Enabled = False
TITULO.Enabled = False
AUTOR.Enabled = False
EDITORIAL.Enabled = False
BIBLIOTECA.Enabled = False
OBSERVACIONES.Enabled = False
AGREGAR.Enabled = True
ALTA.Enabled = False
ACTUALIZAR.Enabled = True
ANULACIÓN.Enabled = False
CANCELAR.Enabled = True
Adodc1.Recordset.CancelUpdate
End Sub
Private Sub ASIGNATURA_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TITULO.SetFocus
End If
End Sub
Private Sub AUTOR_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
EDITORIAL.SetFocus
End If
End Sub
Private Sub BIBLIOTECA_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
OBSERVACIONES.SetFocus
End If
End Sub
Private Sub CANCELAR_Click()
Form3.Visible = True
Form4.Visible = False
NPBG.Enabled = False
REGISTRO.Enabled = False
ASIGNATURA.Enabled = False
TITULO.Enabled = False
AUTOR.Enabled = False
EDITORIAL.Enabled = False
BIBLIOTECA.Enabled = False
OBSERVACIONES.Enabled = False
ALTA.Enabled = False
ACTUALIZAR.Enabled = True
CANCELAR.Enabled = True
AGREGAR.Enabled = True
End Sub
Private Sub EDITORIAL_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
BIBLIOTECA.SetFocus
End If
End Sub
Private Sub Form_Load()
Call Conectar
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 0 Then Cancel = 1
End Sub
Private Sub OBSERVACIONES_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
ALTA.SetFocus
End If
End Sub
Private Sub REGISTRO_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
ASIGNATURA.SetFocus
End If
End Sub
Private Sub Timer1_Timer()
Dim fecha As Variant
fecha = Date
Label4.Caption = Str(fecha)
End Sub
Private Sub TITULO_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
AUTOR.SetFocus
End If
End Sub
Karka!(:
Mensajes enviados
6
Fecha de inscripción
martes, 20 de marzo de 2012
Estatus
Miembro
Última intervención
miércoles, 21 de marzo de 2012
2
21 mar 2012 a las 00:07
21 mar 2012 a las 00:07
intenta hacer todos tus programas mejor con dev c! es mas facil :)
22 mar 2011 a las 16:58
24 abr 2011 a las 20:21
10 may 2011 a las 00:38
Dim rs1 As Recordset
Private Sub CmdEDITAR_Click(Index As Integer)
Dim strtitle As String
Text2.Text = UCase(Text2.Text)
If Text1.Text = "" Then
MsgBox ("Debe introducir el Codigo de la serie.")
Text1.SetFocus
ElseIf (Text2.Text = "") Then
MsgBox ("Debe introducir el Nombre de la serie.")
Text2.SetFocus
End If
strtitle = Text1.Text
rs1.FindFirst "Codserie = '" & strtitle & "'"
If rs1.NoMatch Then
rs1.Edit
End If
End Sub
Private Sub CmdPrimero_Click(Index As Integer)
rs1.MoveFirst
Text1.Text = rs1.Fields("Codserie")
Text2.Text = rs1.Fields("Nomserie")
End Sub
Private Sub CmdUltimo_Click()
rs1.MoveLast
Text1.Text = rs1.Fields("Codserie")
Text2.Text = rs1.Fields("Nomserie")
End Sub
Private Sub Form_Load()
Set db = Workspaces(0).OpenDatabase("C:\PROGRAMASERVICIO\BASE DE DATOS\servicio.mdb")
Set rs1 = db.OpenRecordset("serie", dbOpenDynaset)
End Sub
Private Sub Text1_KEYPRESS(KEYASCII As Integer)
Dim num As String
If Not (KEYASCII >= 48 And KEYASCII <= 57 Or KEYASCII = 8) Then
KEYASCII = 0
End If
num = Len(Text1.Text)
If num = 3 Then
Text2.SetFocus
End If
End Sub
Private Sub CmdGUARDAR_Click(Index As Integer)
Dim strtitle As String
Text2.Text = UCase(Text2.Text)
If Text1.Text = "" Then
MsgBox ("Debe introducir el Codigo de la serie.")
Text1.SetFocus
ElseIf (Text2.Text = "") Then
MsgBox ("Debe introducir el Nombre de la serie.")
Text2.SetFocus
End If
strtitle = Text1.Text
rs1.FindFirst "Codserie = '" & strtitle & "'"
If rs1.NoMatch Then
rs1.AddNew
rs1.Fields("Codserie") = Text1.Text
rs1.Fields("NomSerie") = Text2.Text
rs1.Update
MsgBox ("el registro fue guardado satisfactoriamente")
Else
MsgBox ("El Codigo ya Existe.")
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
End Sub
Private Sub Cmdnuevo_Click(Index As Integer)
rs1.AddNew
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub
Private Sub CmdSALIR_Click(Index As Integer)
Form5.Hide
End Sub
4 ene 2012 a las 17:16
15 jun 2012 a las 19:23