|    
			
				16/11/2008, 12:51
			
			
			  | 
  |   |  |  |  Fecha de Ingreso: julio-2008 
						Mensajes: 205
					 Antigüedad: 17 años, 3 meses Puntos: 1 |  | 
  |  Respuesta: Problemas con numero de registros en una tabla  
  este es el boton guardar, Private Sub guardar_Click(index As Integer)
 Select Case index
 Case 0
 'Agregar
 If (iContadorRegistro <= 4) Then
 'puedo agregar...
 deduc2.Recordset.AddNew
 deduc2.Recordset(0) = Trim(Text1.Text)
 deduc2.Recordset(1) = Abs(Text2.Text)
 deduc2.Recordset.Update
 deduc2.Refresh
 MsgBox "Datos Almacenados Satisfactoriamente", vbInformation, "Guardado"
 
 ' se limpian los datos
 Text1.Text = ""
 Text2.Text = ""
 
 'Y se incrementa para la próxima...
 iContadorRegistro = iContadorRegistro + 1
 
 'se almacena la cantidad de registros.
 SaveSetting App.EXEName, "CONTADOR", "Registros", iContadorRegistro
 
 
 coloque despues del mensaje que se me bloqueara el boton y los textos.
 
 
 
 y en el load ç. coloque unas lineas de codigo mas. On Error Resume Next
 'se inicializan los valores...
 Dim iContador As Integer
 iContador = CInt(GetSetting(App.EXEName, "CONTADOR", "Registros"))
 If (iContador <= 5) Then
 iContadorRegistro = iContador
 Else
 If (iContador = 4) Then
 iContadorRegistro = iContador
 iContadorRegistro = 4
 End If
 End If
 
 y en vez de 5 coloque 4. asi funciona correctamente..
 Else
 'No se pueden agregar...
 MsgBox "Imposible agregar registros, cantidad máxima permitida a sido superada.", vbInformation, "Imposible guardar"
 guardar(0).Enabled = False
 Text1.Enabled = False
 Text2.Enabled = False
 Text1.Text = ""
 Text2.Text = ""
 End If
 Case 1
 'Cerrar
 End
 End Select
 iContadorRegistro = CInt(GetSetting(App.EXEName, "CONTADOR", "Registros"))
 End Sub
     |