MS Access Sub form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to add a command button in the Sub Form, prompt the users , "Are you
sure you want to save the changes?" if the answer is yes, then update. I
want to do the same for deletion. however, instead of deleting the record, I
want to keep the record but flag for deletion.

Could you suggest how I can do it in the sub form. thanks.
Also, I am a new VB user, please give me some coding examples. thanks
 
Hi,
here the idea - add one more yes/no field to your table, say Deleted, in
subform underlying query add criteria - Deleted = False, and then write such
code in button's click event:

if msgbox("Are you sure you want to save the changes?",vbyesno)=vbyes then
me.Deleted=false
else
me.deleted=true
me.requery
end if

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
 
Back
Top