access vba #deleted record on continuous form issue
Posted on 2012-09-05
I am having an issue when I delete a record displayed on a continuous which is bound to a (temporary) table. On the form_load() I populate the table that this form is bound to. Displayed on the form I have a label that I alter the caption property based on a value in the record in the detail_paint() . This works, but I also have a delete button displayed on each record of the form that calls a subroutine when pressed. This sub uses docmd.runsql () to delete the record from the table, then calls me.requery() . When the delete button is pressed, the record is deleted and I see a #deleted value in the bound fields on the form, but then I get an error on the detail_paint() function saying that it cannot find the referenced field (the field I check to determine the caption). I was not expecting to see $deleted, just no record at all in this case. The question is how to get around this error?