Delete subform rec - Cancel

G

Guest

A2002, I have a subform (continuous form) with parent child link to main
form. I have a button on the subform to delete the selected subform record.
When user clicks button, it asks to confirm deletion (default access message,
not my doing).
PROBLEM is if user choses NO on the confirmation screen, the subform record
pointer moves to that record and that record is displayed on the top viewable
row. All records above it are there, but not visable on the screen. I can
alt+tab to scroll to them.
QUESTION: How can I get the subform to point to first record in the subform
after user clicks no on the delete confirmation? If user clicks yes, it
deletes the record fine and viewable records do not move.

'***** partial Code on the delete click

DoCmd.RunCommand acCmdDeleteRecord

Me.Refresh 'my attempt to fix this issue
Me.Repaint 'another attempt to fix

**** end of partial code

Any assistance you can provide is appreciated.
 
R

RuralGuy

Try: Me.requery

A2002, I have a subform (continuous form) with parent child link to main
form. I have a button on the subform to delete the selected subform record.
When user clicks button, it asks to confirm deletion (default access message,
not my doing).
PROBLEM is if user choses NO on the confirmation screen, the subform record
pointer moves to that record and that record is displayed on the top viewable
row. All records above it are there, but not visable on the screen. I can
alt+tab to scroll to them.
QUESTION: How can I get the subform to point to first record in the subform
after user clicks no on the delete confirmation? If user clicks yes, it
deletes the record fine and viewable records do not move.

'***** partial Code on the delete click

DoCmd.RunCommand acCmdDeleteRecord

Me.Refresh 'my attempt to fix this issue
Me.Repaint 'another attempt to fix

**** end of partial code

Any assistance you can provide is appreciated.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
D

David

RuralGuy,
Thank you for the response. Unfortunately, that didn't work
..
I have turned on the error trapping and am getting a "RESERVED WORD" error
after the delete record command. Not sure why, since this is the last code
in the event.

Can I set focus to the first record in the record set clone? If so, how?
 
D

David

I am encountering an error after this event that is causing the subform to
not behave as expected. Project can't find field "|" referenced in
expression.
I'll have to step thru my code.

Thank you everyone.
 
R

RuralGuy

Hi David,

It sounds like you are on the right track. When I see strange behavior I
recommend making sure there are no MISSING references and that Name Auto-Correct
is turned off.
http://allenbrowne.com/bug-03.html
http://allenbrowne.com/ser-38.html

Hope that helps.

I am encountering an error after this event that is causing the subform to
not behave as expected. Project can't find field "|" referenced in
expression.
I'll have to step thru my code.

Thank you everyone.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top