cuando corro mi aplicacion me aparece el sig msj:
error 3021 en tiempo de ejecucion
either BOF or EOF is true, or the currente record has been deleted.
requested operation requires a current record.
| |||
error 3021 en tiempo de ejecucion cuando corro mi aplicacion me aparece el sig msj: error 3021 en tiempo de ejecucion either BOF or EOF is true, or the currente record has been deleted. requested operation requires a current record. |
| |||
Re: error 3021 en tiempo de ejecucion he estado modificando el codigo ..... pero no encuentro la solucion !!! te envio el codigo.... haber si m puedes ayudar...... Private Sub btn_save_Click() Dim weekRepId As Integer Dim appProfile As Integer Dim projId As String Dim actId As String Dim comp As Integer Dim siExiste As Boolean Dim countreg As Integer If Text1.Visible Then fgd_timesheet = Text1 Text1.Visible = False RecalcTotal (fgd_timesheet.Col) End If 'checa si ya esta cerrado el registro Set rst = New ADODB.Recordset strSQL = " SELECT distinct id " & _ " FROM current_week_report, current_daily_entry " & _ " WHERE id = week_report_id " & _ " AND signature = '" & TRUser & "' " & _ " AND current_week_report.week_id = " & txt_week & " " & _ " AND completed = 1 " rst.Open strSQL, de_TimeReportDB.cnn_TimeReportDB, adOpenStatic, adLockReadOnly, adCmdText If Not rst.EOF Then Exit Sub ' clean up rst.Close Set rst = Nothing countreg = 0 'adquiere el week_report_id Set rst = New ADODB.Recordset strSQL = " SELECT distinct id " & _ " FROM current_week_report, current_daily_entry " & _ " WHERE id = week_report_id " & _ " AND signature = '" & TRUser & "' " & _ " AND current_week_report.week_id = " & txt_week & " " & _ " AND completed = 0 " & _ " AND current_week_report.approved = 0 " rst.Open strSQL, de_TimeReportDB.cnn_TimeReportDB, adOpenStatic, adLockReadOnly, adCmdText siExiste = False Do While Not rst.EOF siExiste = True weekRepId = Val(rst!id) rst.MoveNext Loop ' clean up rst.Close Set rst = Nothing If siExiste = True Then 'Elimina registros strSQL = "Delete from current_daily_entry where week_report_id = " & weekRepId & " " de_TimeReportDB.cnn_TimeReportDB.Execute strSQL Else 'si no existe el registro sacar week_report_id Set rst = New ADODB.Recordset rst.Open "select MAX(id) from current_week_report", de_TimeReportDB.cnn_TimeReportDB, , , adCmdText weekRepId = Val(rst.GetString) + 1 rst.Close 'sacar el apprProfile Set rst = New ADODB.Recordset rst.Open "select id from appusr_profile where appr_dept_id = '" & TRDept & "' and isDrag=1 ", de_TimeReportDB.cnn_TimeReportDB, , , adCmdText appProfile = Val(rst.GetString) //aqui marca el error.... rst.Close 'Escribe registro en current_week_report strSQL = "Insert into current_week_report values (" & weekRepId & "," & _ appProfile & "," & txt_week & ",0)" de_TimeReportDB.cnn_TimeReportDB.Execute strSQL End If gracias |
| ||||
Re: error 3021 en tiempo de ejecucion al inicio de tu codigo : on error resume next ... ... ... appProfile = Val(rst.GetString) //aqui marca el error.... if err.number<>0 then msgbox("Dato no existe") else aqui continua con tu codigo bla bla bla endif |
| |||
Re: error 3021 en tiempo de ejecucion yap.. gracias, con esa instruccio mi applicacion ya no marca el error.... creo q tengo problemas con las tablas de 1 departamento, pero ya las cheque y no me aparece nada fuera de lo normal...... para poner un update porque hice modificaciones en tablas, lo puedo definir en el inicio del codigo?? o a q nivel va??..... estoy utilizando esta sintaxis: UPDATE tabla SET nombre_campo = 'nuevo_valor' WHERE opciones_a_tener_en_cuenta |