on_delete requery

  • Thread starter Thread starter SAC
  • Start date Start date
S

SAC

When I delete a record I want to mark a control on the form which is bound
to the deleted (Y/N) field and then requery the data source and then move to
a new record.

The "deleted" record will still be in the table but will no longer show on
the form because the underlying query's criteria is set to on show records
who's deleted field is false.

Here's what's in the form's in_delete event:
txtDeleted = -1
DoCmd.Save
Forms![frmEstrh].Requery
Cancel = -1
DoCmd.GoToRecord , , acNewRec

I get an error that says "Operation not supported in transactions." How can
I make this work?

Thanks.
 
Add another boolean field to the table... call it something like Active..
default value for normal records is true. Use a query for your form to only
include Active records and replace your pseudo delete code with just
changing the value to false.
 
Then, how do I only display the Active records without closing out the form
and reopening it?

Don't I need to requery the record source so only the Active records show?


Rob Oldfield said:
Add another boolean field to the table... call it something like Active..
default value for normal records is true. Use a query for your form to only
include Active records and replace your pseudo delete code with just
changing the value to false.


SAC said:
When I delete a record I want to mark a control on the form which is bound
to the deleted (Y/N) field and then requery the data source and then
move
to
a new record.

The "deleted" record will still be in the table but will no longer show on
the form because the underlying query's criteria is set to on show records
who's deleted field is false.

Here's what's in the form's in_delete event:
txtDeleted = -1
DoCmd.Save
Forms![frmEstrh].Requery
Cancel = -1
DoCmd.GoToRecord , , acNewRec

I get an error that says "Operation not supported in transactions." How can
I make this work?

Thanks.
 
Yes. You'll need a requery.


SAC said:
Then, how do I only display the Active records without closing out the form
and reopening it?

Don't I need to requery the record source so only the Active records show?


Rob Oldfield said:
Add another boolean field to the table... call it something like Active..
default value for normal records is true. Use a query for your form to only
include Active records and replace your pseudo delete code with just
changing the value to false.


move
show
on
the form because the underlying query's criteria is set to on show records
who's deleted field is false.

Here's what's in the form's in_delete event:
txtDeleted = -1
DoCmd.Save
Forms![frmEstrh].Requery
Cancel = -1
DoCmd.GoToRecord , , acNewRec

I get an error that says "Operation not supported in transactions."
How
can
I make this work?

Thanks.
 
Thanks.

Rob Oldfield said:
Yes. You'll need a requery.


SAC said:
Then, how do I only display the Active records without closing out the form
and reopening it?

Don't I need to requery the record source so only the Active records show?


Rob Oldfield said:
Add another boolean field to the table... call it something like Active..
default value for normal records is true. Use a query for your form
to
only
include Active records and replace your pseudo delete code with just
changing the value to false.


When I delete a record I want to mark a control on the form which is bound
to the deleted (Y/N) field and then requery the data source and then move
to
a new record.

The "deleted" record will still be in the table but will no longer
show
on
the form because the underlying query's criteria is set to on show records
who's deleted field is false.

Here's what's in the form's in_delete event:
txtDeleted = -1
DoCmd.Save
Forms![frmEstrh].Requery
Cancel = -1
DoCmd.GoToRecord , , acNewRec

I get an error that says "Operation not supported in transactions." How
can
I make this work?

Thanks.
 
Back
Top