AYUDA CON BOTONES ATRAS Y DELANTE!!!!!
Publicado por AINHOA (45 intervenciones) el 23/03/2004 13:53:48
Con command_2 y command_3 lo q pretendo es q los registros q aparecen en los textos avancen y retrocedan clickando n los botones, pero no m funciona, alguienpuede decirme n q fallo o como lo puedo hacer?? GRACAIS!
Option Explicit
Private Sub Command1_Click()
Dim rs As Recordset
Set rs = CreateObject("Adodb.recordset")
Dim cn As Connection
Set cn = CreateObject("Adodb.connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Mis documentos\Ainhoa\ainhoa\piezas - verificadores\PRUEBA.mdb;Persist Security Info=False", "admin"
rs.Open "select * from verificadores where " & Text1.Text & " = cod_pieza", cn, 3, 3
Text2.Text = rs.Fields(0).Value
Text3.Text = rs.Fields(1).Value
Text4.Text = rs.Fields(2).Value
Text5.Text = rs.Fields(3).Value
Text6.Text = rs.Fields(4).Value
rs.Close
cn.Close
End Sub
Private Sub Command2_Click()
rs.MoveNext
Text2.Text = rs.Fields(0).Value
Text3.Text = rs.Fields(1).Value
Text4.Text = rs.Fields(2).Value
Text5.Text = rs.Fields(3).Value
Text6.Text = rs.Fields(4).Value
rs.Close
End Sub
Private Sub Command3_Click()
rs.MovePrevious
Text2.Text = rs.Fields(0).Value
Text3.Text = rs.Fields(1).Value
Text4.Text = rs.Fields(2).Value
Text5.Text = rs.Fields(3).Value
Text6.Text = rs.Fields(4).Value
re.Close
End Sub
Private Sub salir_Click()
Form1.Show
Form4.Hide
End Sub
Option Explicit
Private Sub Command1_Click()
Dim rs As Recordset
Set rs = CreateObject("Adodb.recordset")
Dim cn As Connection
Set cn = CreateObject("Adodb.connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Mis documentos\Ainhoa\ainhoa\piezas - verificadores\PRUEBA.mdb;Persist Security Info=False", "admin"
rs.Open "select * from verificadores where " & Text1.Text & " = cod_pieza", cn, 3, 3
Text2.Text = rs.Fields(0).Value
Text3.Text = rs.Fields(1).Value
Text4.Text = rs.Fields(2).Value
Text5.Text = rs.Fields(3).Value
Text6.Text = rs.Fields(4).Value
rs.Close
cn.Close
End Sub
Private Sub Command2_Click()
rs.MoveNext
Text2.Text = rs.Fields(0).Value
Text3.Text = rs.Fields(1).Value
Text4.Text = rs.Fields(2).Value
Text5.Text = rs.Fields(3).Value
Text6.Text = rs.Fields(4).Value
rs.Close
End Sub
Private Sub Command3_Click()
rs.MovePrevious
Text2.Text = rs.Fields(0).Value
Text3.Text = rs.Fields(1).Value
Text4.Text = rs.Fields(2).Value
Text5.Text = rs.Fields(3).Value
Text6.Text = rs.Fields(4).Value
re.Close
End Sub
Private Sub salir_Click()
Form1.Show
Form4.Hide
End Sub
Valora esta pregunta


0