Ver Mensaje Individual
  #5 (permalink)  
Antiguo 09/05/2011, 11:28
t0n1
 
Fecha de Ingreso: noviembre-2010
Mensajes: 175
Antigüedad: 13 años, 5 meses
Puntos: 1
Respuesta: Problema con delete de registros.

Cita:
Iniciado por culd Ver Mensaje
Si le llamas 01, 02, 03 a un campo autonumerico...

Lo que tenes que hacer es en tu consulta ordenar de forma ascendente y se termino el problema.
¿Dónde tendría que poner el order by?. Acá está el código que utilizo:

If Not Conectar() Then Exit Sub

sql = "select * from Informes where Codigo = " & lblCodigo.Caption & ""
Set Rs = Cn.Execute(sql)
If Rs.EOF Then
sql = "insert into Informes (Codigo, Apellido, Domicilio, Telefono, Localidad, Email, Interesado) values (" & lblCodigo.Caption & ", '" & txtApellido.Text & "', '" & txtDomicilio.Text & "', '" & txtTelefono.Text & "', '" & txtLocalidad.Text & "', '" & txtEmail.Text & "', " & cmbCurso & ")"
MsgBox "Registro agregado"
txtApellido.Text = ""
txtDomicilio.Text = ""
txtTelefono.Text = ""
txtLocalidad.Text = ""
txtEmail.Text = ""
txtApellido.SetFocus
End If

Set Rs = Cn.Execute(sql)

Set Rs = Nothing