ayuda con codigo, por favor!!!! urgente
Publicado por ainhoa (56 intervenciones) el 27/04/2004 15:48:14
Los asteriscos es dnd da el error
Option Compare Database
Public dbs As Database
Public rstpro As Recordset
Public rsttmp As Recordset
Public msg As String
Private Sub Proveed_Click()
Set dbs = CurrentDb()
If Me.Proveed <> "" Then
DoCmd.RunSQL "DELETE * FROM control_entrega2"
*****Set rstpro = dbs.OpenRecordset("control_entrega2", dbopentable)
Set rsttmp = dbs.OpenRecordset("SELECT control_de_entrega.*, control_de_entrega.Proveedor_subcontratista " _
& "FROM control_de_entrega " _
& "WHERE (((control_de_entrega.Proveedor_subcontratista)= '" & Me.Proveed & "'))AND fecha>=a_fecha AND fecha<=d_fecha;")
xy = rsttmp.RecordCount
If Not rsttmp.EOF Then
Do Until rsttmp.EOF
With rstpro
.AddNew
!cod_prov = rsttmp!cod_prov
!referencia = rsttmp!referencia
!fecha = rsttmp!fecha
!cant_revisada = rsttmp!cant_revisada
!fecha_aceptacion = rsttmp!fecha_aceptacion
!resultados = rsttmp!resultados
!nivel = rsttmp!nivel
!observaciones = rsttmp!observaciones
.Update
End With
rsttmp.MoveNext
Loop
End If
Else
msg = MsgBox("Debes Elegir el Proveedor", vbOKOnly + vbCritical, "Centro de mensajes")
End If
Me.Refresh
End Sub
Private Sub Form_Open(Cancel As Integer)
Set dbs = CurrentDb()
End Sub
Option Compare Database
Public dbs As Database
Public rstpro As Recordset
Public rsttmp As Recordset
Public msg As String
Private Sub Proveed_Click()
Set dbs = CurrentDb()
If Me.Proveed <> "" Then
DoCmd.RunSQL "DELETE * FROM control_entrega2"
*****Set rstpro = dbs.OpenRecordset("control_entrega2", dbopentable)
Set rsttmp = dbs.OpenRecordset("SELECT control_de_entrega.*, control_de_entrega.Proveedor_subcontratista " _
& "FROM control_de_entrega " _
& "WHERE (((control_de_entrega.Proveedor_subcontratista)= '" & Me.Proveed & "'))AND fecha>=a_fecha AND fecha<=d_fecha;")
xy = rsttmp.RecordCount
If Not rsttmp.EOF Then
Do Until rsttmp.EOF
With rstpro
.AddNew
!cod_prov = rsttmp!cod_prov
!referencia = rsttmp!referencia
!fecha = rsttmp!fecha
!cant_revisada = rsttmp!cant_revisada
!fecha_aceptacion = rsttmp!fecha_aceptacion
!resultados = rsttmp!resultados
!nivel = rsttmp!nivel
!observaciones = rsttmp!observaciones
.Update
End With
rsttmp.MoveNext
Loop
End If
Else
msg = MsgBox("Debes Elegir el Proveedor", vbOKOnly + vbCritical, "Centro de mensajes")
End If
Me.Refresh
End Sub
Private Sub Form_Open(Cancel As Integer)
Set dbs = CurrentDb()
End Sub
Valora esta pregunta


0