Cita:
Iniciado por GeoAvila
Primero creo que tenes que comenzar haciendo la conexión revisate el foro de Visual Basic, estas en el de Programación, y allí en las FAQ's hay unos ejemplo de conexión cuando ya tengas la conexión hecha, bueno podemos ver lo tu frame..
nos vemos..
Gracias por responder, pense que ya no me ivan a tomar en cuenta jejeje
mira este es el formulario que tengo, lo que me falta es programar el option button dentro de un frame, las opciones del OPTIONBUTTON son Formal y Semiformal y quiero que al momento de escoger uno me guarde en una tabla access 2000 llamada Actividad en un campo llamado ClasActividad
Porfavor Ayudame
Gracias
Option Explicit
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
'Connection Confirmation
Private Sub Form_Load()
Set cnn = Nothing
Set rs = Nothing
' establece la cadena de conexión a utilizar en la propiedad ConnectionString
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
App.Path & "\Negocios.mdb" & ";Persist Security Info=False"
' abre la base de datos
cnn.Open
' abre el recordset enviando la consulta sql
rs.Open "Select * from ACTIVIDAD", cnn, adOpenDynamic, adLockOptimistic
End Sub
Private Sub cmdAnterior_Click()
Unload Me
frmIngresosMensuales.Show 1
End Sub
Private Sub cmdSalir_Click()
Unload Me
End Sub
Private Sub cmdSiguiente_Click()
rs.AddNew
If txtGiroelCliente = "" Or txtCodigo = "" Or txtDireccionComercial = "" Or txtAntiguedadActividad = "" Or txtAntiguedadLaboralMeses = "" Or txtAntiguedadLaboralAños = "" Or txtIniciacion = "" Then
If MsgBox("Debe completar los datos para poder continuar", vbExclamation, "Advertencia") = vbYes Then
End If
Exit Sub
End If
Call Asignar_Datos
rs.Update
MsgBox "Registro Guardado", vbInformation
Unload Me
frmPersonasQueTrabajan.Show 1
End Sub
Private Sub Command1_Click()
End Sub
'Limpia las cajas de texto
Private Sub clear()
txtGiroelCliente.Text = ""
txtCodigo.Text = ""
txtDireccionComercial.Text = ""
txtAntiguedadActividad.Text = ""
txtAntiguedadLaboralMeses.Text = ""
txtAntiguedadLaboralAños.Text = ""
txtIniciacion.Text = ""
End Sub
' Sub que asigna los datos al recordset
Private Sub Asignar_Datos()
rs("Descripcion") = txtGiroelCliente.Text
rs("CodigoSII") = txtCodigo.Text
rs("DireccionComercial") = txtDireccionComercial.Text
rs("AñosAntiguedadAct") = txtAntiguedadActividad.Text
rs("AntiguedadDomLaboralMes") = txtAntiguedadLaboralMeses.Text
rs("AntiguedadDomLaboralAno") = txtAntiguedadLaboralAños.Text
rs("IniciacionActividad") = txtIniciacion.Text
End Sub
Private Sub fraClasificación_DragDrop(Source As Control, X As Single, Y As Single)
End Sub Private Sub optClasificacion_Click()
End Sub
Private Sub txtAntiguedadActividad_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc(0) Or KeyAscii > Asc(9)) And KeyAscii <> 8 And KeyAscii <> 46 Then
KeyAscii = 0
End If
End Sub
Private Sub txtAntiguedadLaboralAños_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc(0) Or KeyAscii > Asc(9)) And KeyAscii <> 8 And KeyAscii <> 46 Then
KeyAscii = 0
End If
End Sub
Private Sub txtAntiguedadLaboralMeses_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc(0) Or KeyAscii > Asc(9)) And KeyAscii <> 8 And KeyAscii <> 46 Then
KeyAscii = 0
End If
End Sub
Private Sub txtIniciacion_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc(0) Or KeyAscii > Asc(9)) And KeyAscii <> 8 And KeyAscii <> 46 Then
KeyAscii = 0
End If
End Sub