Kamis, 31 Januari 2019

Re: [MS_AccessPros] How to delete the current record and close the form afterwards.

 

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)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Tidak ada komentar:

Posting Komentar