删除按钮不询问用户是否要先删除记录 [英] Delete button not asking if the user wants to delete record first

查看:106
本文介绍了删除按钮不询问用户是否要先删除记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用按钮向导设置删除记录按钮。它会删除一条记录,然后移动到下一条记录,但是我需要它在删除之前先询问用户,如果它是最后一条记录,我需要它来返回上一条记录。

I与宏一起工作并不是真正的家庭。

这是一个简单的解决方案还是应该用代码代替?


v / r,

jason

I used the button wizard to set up a delete record button. It does delete a record and then moves to the next record, however I need it to ask the user first before deleting and also if it is the last record I need it to return the previous record.
I''m not real familier with working with macros.
Is this an easy fix or should this be in code instead?

v/r,
jason

推荐答案

我们这个论坛的大多数人都使用VBA来做所有事情,所以大多数解决方案都可能会使用VBA。


我要做的是使用MsgBox函数询问用户是否要删除记录。如果是,则使用 Recordset.Delete 方法删除记录,然后执行MovePrevious去上一条记录。
Most of us in this forum use VBA for everything, so most solutions will probably use VBA.

What I would do is to use the MsgBox function to ask the user if they want to delete the record. If yes, then use the Recordset.Delete method to delete the record and then do a MovePrevious to go the previous record.


好的,我已经把这段代码放在一起,但是想让你看看它,所以我不能删除一些我不应该...就像我的整个形式或东西。

Ok so, I''ve put together this code but wanted you to look at it so I don''t delete something I shouldn''t...like my whole form or something.

展开 | 选择 | Wrap | 行号


这对Jason来说似乎是个好问题。这是代码的替代版本,其中一些注释解释了其中的一些和差异:

That seems like a good question to ask Jason. Here is an alternative version of your code with some comments explaining some of it and the differences :

展开 | 选择 | Wrap | 行号


这篇关于删除按钮不询问用户是否要先删除记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆