ms access - VBA Recordset Update Hanging On Specfic Record -
so have below...
sub test4() dim db dao.database dim source_rst dao.recordset dim dest_rst dao.recordset set db = currentdb set source_rst = db.openrecordset("select distinctrow [scorecard last ran].[scorecard id], round(([dqs - scorecard history].[no passed]/([dqs - scorecard history].[no passed]+[dqs - scorecard history].[no failed]))*100,1) & '%' score [dqs - scorecards] inner join ((select [dqs - scorecard history].[scorecard id], max([dqs - scorecard history].[date/time scorecard ran]) [maxofdate/time scorecard ran] [dqs - scorecard history] group [dqs - scorecard history].[scorecard id]) [scorecard last ran] inner join [dqs - scorecard history] on ([scorecard last ran].[maxofdate/time scorecard ran] = [dqs - scorecard history].[date/time scorecard ran]) , ([scorecard last ran].[scorecard id] = [dqs - scorecard history].[scorecard id])) on [dqs - scorecards].id = [dqs - scorecard history].[scorecard id];") set dest_rst = db.openrecordset("dqs - scorecards") if (source_rst.bof , source_rst.eof) or (dest_rst.bof , dest_rst.eof) exit sub while (not source_rst.eof) dest_rst.movefirst while (not dest_rst.eof) if dest_rst![id] = source_rst![scorecard id] , dest_rst![id] <> 3 debug.print source_rst![scorecard id] & " - " & source_rst![score] dest_rst.edit dest_rst![score] = source_rst![score] dest_rst.update doevents end if dest_rst.movenext wend source_rst.movenext wend end sub
fairly straightforward right? except if remove dest_rst![id] <> 3
hangs, if leave hours. there nothing special record 3, , data going in same, percentage formatted string. works great if exclude record.
i know update query more efficient hangs too. missing?!
the dest_rst small sharepoint list.
turns out sharepoint list being arse. deleted list db, re-added it, well, sanity restored!
wiki
Comments
Post a Comment