Boton ultimo Registro
Publicado por RUBEN (2 intervenciones) el 18/06/2006 16:59:21
hola estoy haciendo 1 array de estructuras, no uso bases de datos, los datos se borran al cerrar el programa.el problema es uqe con el boton de ir al ultimo registro...no me funciona xq el ultimo registro no siempre es el mismo(el array es dinamico).os pongo el codigo del boton siguiente registro (>) (q ese si me funciona bien) aver si m podeis exar 1 mano con el codigo del ultimo registro.
Private Sub Command7_Click() ' funciona correctamente!!!
Njug = Njug + 1
If Text1.Text = "" Then
MsgBox "No hay mas registros."
Else
With Equipo(Njug)
Text1.Text = .Nombre
Text2.Text = .Fecha
Text3.Text = .Internacional
Text4.Text = .Goles
cmbdorsal.Text = .Dorsal
cmbPuesto.Text = .Puesto
End With
End If
End Sub
y el codigo que tengo para el boton ultimo registro ( >| )es :
Private Sub Command8_Click()
Njug = 25 'nº registros maximos
While Njug.Nombre = "" 'comprueba el ultimo registro si es vacio
Njug = Njug - 1 'comprueba el anterior hasta que tenga 1 no vacio
Wend
With Equipo(Njug) ' pero aki me usa el valor 25 en vez d el que sea
Text1.Text = .Nombre
Text2.Text = .Fecha
Text3.Text = .Internacional
Text4.Text = .Goles
cmbdorsal.Text = .Dorsal
cmbPuesto.Text = .Puesto
End With
End Sub
Private Sub Command7_Click() ' funciona correctamente!!!
Njug = Njug + 1
If Text1.Text = "" Then
MsgBox "No hay mas registros."
Else
With Equipo(Njug)
Text1.Text = .Nombre
Text2.Text = .Fecha
Text3.Text = .Internacional
Text4.Text = .Goles
cmbdorsal.Text = .Dorsal
cmbPuesto.Text = .Puesto
End With
End If
End Sub
y el codigo que tengo para el boton ultimo registro ( >| )es :
Private Sub Command8_Click()
Njug = 25 'nº registros maximos
While Njug.Nombre = "" 'comprueba el ultimo registro si es vacio
Njug = Njug - 1 'comprueba el anterior hasta que tenga 1 no vacio
Wend
With Equipo(Njug) ' pero aki me usa el valor 25 en vez d el que sea
Text1.Text = .Nombre
Text2.Text = .Fecha
Text3.Text = .Internacional
Text4.Text = .Goles
cmbdorsal.Text = .Dorsal
cmbPuesto.Text = .Puesto
End With
End Sub
Valora esta pregunta


0