最后一个复选框不想派对 [英] Last checkbox doesnt want to party

查看:54
本文介绍了最后一个复选框不想派对的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我是相对新手,在Access 2002中有一个棘手的问题。


我有一个连续的表格一个名为选择的复选框。 (我现在知道了

我不应该这么称呼它,但现在改变已经太晚了。)


我已经设置一个命令按钮,使用以下代码将复选框从Yes更改为No

: -


设置db = CurrentDb

db.Execute" UPDATE DISTINCTROW联系人SET [Select] = 0"

Me.Dirty = False


这设法更改所有支票盒子除了一个 - 它总是

我之前点击的最后一个。当我关闭并重新打开表单时,最后一个只有

被清除。在搜索了解决方案后,我看到了类似的东西,因此放入了

Me.Dirty = False位,但这似乎无法奏效。


打开/关闭例程会让所有用户感到恼火,因为当它重新打开时,表单会跳转到第一个记录。我们有一些类似

2600的记录,压力正在寻找修复。


任何人都可以帮忙吗?谢谢


Caroline

Hi,

I''m a relative newby and have a tricky problem in Access 2002.

I have a continuous form with a check box called "Select". (I now know
I shouldn''t have called it that but it''s way too late to change now).

I''ve set up a command button to changes the check box from Yes to No
with the following code:-

Set db = CurrentDb
db.Execute "UPDATE DISTINCTROW Contacts SET [Select] = 0 "
Me.Dirty = False

This manages to change all the check boxes EXCEPT one - it''s invariably
the last one that I had previously clicked on. This last one only
becomes cleared when I close and re-open the form. Having scoured the
NG for solutions I saw something similar and hence put in the
Me.Dirty=False bit but that doesn''t seem to work.

The open/close routine is irritating to all the users, as when it
re-opens, the form jumps to the first records. We''ve got something like
2600 records and the pressure is on to find a fix.

Can any one help? Thanks

Caroline

推荐答案

1。在*执行更新查询语句之前保存当前记录*

(即将Me.Dirty行放在第一位。)


2.在执行中使用dbFailOnError line,所以你可以听到任何没有正确更新的
,即:

db.Execute" UPDATE ...",dbfailOnError


-

Allen Browne - 微软MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


< sa **** ***@yahoo.com>在消息中写道

news:11 ********************** @ g49g2000cwa.googlegr oups.com ...
1. Save the current record *before* executing the update query statement
(i.e. put the Me.Dirty line first.)

2. Use dbFailOnError in the execute line, so you get to hear about anything
that does not update properly, i.e.:
db.Execute "UPDATE...", dbfailOnError

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<sa*******@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...


我是相对新手,在Access 2002中有一个棘手的问题。

我有一个连续的表单,上面有一个名为Select的复选框;。 (我现在知道
我不应该这么称呼它,但现在改变已经太晚了。)

我已经设置了一个命令按钮来改变它使用以下代码从Yes到No
复选框: -

设置db = CurrentDb
db.Execute" UPDATE DISTINCTROW Contacts SET [Select] = 0"
Me.Dirty = False

这设法改变所有复选框除了一个 - 它总是
我之前点击的最后一个。当我关闭并重新打开表单时,最后一个只会被清除。在搜索了NG的解决方案后,我看到了类似的东西,因此放入了
Me.Dirty = False位,但这似乎无法工作。

打开/关闭例程会刺激所有用户,因为当它重新打开时,表单会跳转到第一个记录。我们有类似的2600条记录,并且正在寻找解决方案的压力。

任何人都可以提供帮助吗?谢谢

Caroline
Hi,

I''m a relative newby and have a tricky problem in Access 2002.

I have a continuous form with a check box called "Select". (I now know
I shouldn''t have called it that but it''s way too late to change now).

I''ve set up a command button to changes the check box from Yes to No
with the following code:-

Set db = CurrentDb
db.Execute "UPDATE DISTINCTROW Contacts SET [Select] = 0 "
Me.Dirty = False

This manages to change all the check boxes EXCEPT one - it''s invariably
the last one that I had previously clicked on. This last one only
becomes cleared when I close and re-open the form. Having scoured the
NG for solutions I saw something similar and hence put in the
Me.Dirty=False bit but that doesn''t seem to work.

The open/close routine is irritating to all the users, as when it
re-opens, the form jumps to the first records. We''ve got something like
2600 records and the pressure is on to find a fix.

Can any one help? Thanks

Caroline



>我是一个相对新手,在Access 2002中有一个棘手的问题。
> I''m a relative newby and have a tricky problem in Access 2002.

我有一个连续的表单,上面有一个名为Select的复选框。 (我现在知道
我不应该这么称呼它,但现在改变已经太晚了。)

我已经设置了一个命令按钮来改变它使用以下代码从Yes到No
复选框: -

设置db = CurrentDb
db.Execute" UPDATE DISTINCTROW Contacts SET [Select] = 0"
Me.Dirty = False

这设法改变所有复选框除了一个 - 它总是
我之前点击的最后一个。

I have a continuous form with a check box called "Select". (I now know
I shouldn''t have called it that but it''s way too late to change now).

I''ve set up a command button to changes the check box from Yes to No
with the following code:-

Set db = CurrentDb
db.Execute "UPDATE DISTINCTROW Contacts SET [Select] = 0 "
Me.Dirty = False

This manages to change all the check boxes EXCEPT one - it''s invariably
the last one that I had previously clicked on.




记录被表单锁定,不会从查询中更新。

您正在保存它(以及清除锁定)*在*之后尝试更新

查询。将线路向上移动一个位置就可以播出了。


你可以做到


db.execute SQLstring,dbfailonerror


获取可捕获的错误消息(在这种情况下:并非所有记录都可以更新
更新 - 我希望:-)但是在你的情况下我觉得它足够了保存

来自代码的记录。


runco​​mmand accmdsaverecord


也会在db.execute之前执行

我仍​​然犹豫建议脏=假,因为它不看我

喜欢储蓄。考虑一下个人评论,如果有效,为什么要这么麻烦?


-

Bas Cost Budde,Holland
http://www.heuveltop.nl/BasCB/msac_index.html



The record is locked by the form and will not be updated from the query.
You are saving it (and so clearing the lock) *after* you try the update
query. Move the line one position up and you will be on air.

You can do

db.execute SQLstring, dbfailonerror

to get a trappable error message (in this case: not all records can be
updated--I hope :-) but in your case I think it is sufficient to save
the record from code.

runcommand accmdsaverecord

will do too, just before the db.execute
I still hesitate to suggest dirty=false because it doesn''t look to me
like saving. Consider that a personal remark, if it works, why bother?

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html


对你好,艾伦,这是我的一天!并且还要感谢额外的小费




所有这些进展都在我脑海中,并提示我询问是否有

一个简单的方法来获得这样的命令来报告修改后的记录数量




我真的可以使用这样的信息在一些其他复选框上

在同一个连续表格上。


非常感谢


Caroline


Allen Browne写道:
Good on you Allen, that''s made my day! And thanks for the extra tip
too.

All this progress is going to my head and prompts me to ask if there''s
an easy way to get such a command to report back the number of records
that are modified.

I could really usefully use such info on some of the other checkboxes
that are on the same continuous form.

Many thanks

Caroline

Allen Browne wrote:
1.在执行更新查询语句之前保存当前记录*(即将Me.Dirty行放在第一位) 。)

2.在执行行中使用dbFailOnError,这样你就可以听到任何不能正确更新的内容,即:
db.Execute" UPDATE .. 。,dbfailOnError

- 艾伦布朗 - 微软MVP。西澳大利亚州珀斯。
访问用户提示 - http://allenbrowne.com/ tips.html
回复群组,而非mvps dot org的allenbrowne。

< sa ******* @ yahoo.com>在消息中写道
新闻:11 ********************** @ g49g2000cwa.googlegr oups.com ...
1. Save the current record *before* executing the update query statement
(i.e. put the Me.Dirty line first.)

2. Use dbFailOnError in the execute line, so you get to hear about anything
that does not update properly, i.e.:
db.Execute "UPDATE...", dbfailOnError

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<sa*******@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...


我是相对新手,在Access 2002中有一个棘手的问题。

我有一个连续的表单,上面有一个名为Select的复选框。 (我现在知道
我不应该这么称呼它,但现在改变已经太晚了。)

我已经设置了一个命令按钮来改变它使用以下代码从Yes到No
复选框: -

设置db = CurrentDb
db.Execute" UPDATE DISTINCTROW Contacts SET [Select] = 0"
Me.Dirty = False

这设法改变所有复选框除了一个 - 它总是
我之前点击的最后一个。当我关闭并重新打开表单时,最后一个只会被清除。在搜索了NG的解决方案后,我看到了类似的东西,因此放入了
Me.Dirty = False位,但这似乎无法工作。

打开/关闭例程会刺激所有用户,因为当它重新打开时,表单会跳转到第一个记录。我们有类似的2600条记录,并且正在寻找解决方案的压力。

任何人都可以提供帮助吗?谢谢

Caroline
Hi,

I''m a relative newby and have a tricky problem in Access 2002.

I have a continuous form with a check box called "Select". (I now know
I shouldn''t have called it that but it''s way too late to change now).

I''ve set up a command button to changes the check box from Yes to No
with the following code:-

Set db = CurrentDb
db.Execute "UPDATE DISTINCTROW Contacts SET [Select] = 0 "
Me.Dirty = False

This manages to change all the check boxes EXCEPT one - it''s invariably
the last one that I had previously clicked on. This last one only
becomes cleared when I close and re-open the form. Having scoured the
NG for solutions I saw something similar and hence put in the
Me.Dirty=False bit but that doesn''t seem to work.

The open/close routine is irritating to all the users, as when it
re-opens, the form jumps to the first records. We''ve got something like
2600 records and the pressure is on to find a fix.

Can any one help? Thanks

Caroline






这篇关于最后一个复选框不想派对的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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