hi Kevin,
I like using SQL to delete as opposed to DoCmd.DeleteRecord
'~~~~~~~~~~~~~~~~~~~~~~~~~
dim sSQL as string
sSQL = "DELETE A.* FROM [MyTable] as A WHERE [MyPrimaryKey]=" &
me.controlnamePK
currentDb.execute sSQL
'~~~~~~~~~~~~~~~~~~~~~~~~~
to close form:
'~~~~~~~~~~~~~~~~~~~~~~~~~
DoCmd.Close acForm, me.name 'if in code behind form
'~~~~~~~~~~~~~~~~~~~~~~~~~
I generally also specify the Save parameter as No when closing the form.
Make sure you save your code first.
~crystal
On 1/31/2019 8:21 AM, Qingqing qingqinga@yahoo.com
[MS_Access_Professionals] wrote:
> Dear All,
> How to delete a current record in an opened Single form and close the form after the deletion. Thanks. I have tried many ways, none of them work really well. Please help.
> Best Regards,
> Kevin
>
>
> ------------------------------------
> Posted by: Qingqing <qingqinga@yahoo.com>
> ------------------------------------
>
>
> ------------------------------------
>
> Yahoo Groups Links
>
>
>
Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar