复选框会更改所有记录,但不会保留相同的选择。 [英] Checkbox changes all records and does not keep it same selection.

查看:60
本文介绍了复选框会更改所有记录,但不会保留相同的选择。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


我正在构建一个小型表格,它将某些信息与某个复选框相关联,这意味着,当我在文件中有一个TRUE值时,此操作将触发该操作另一个字段位于一个被带入查询的表中,将覆盖文本-1


所以当我勾选它时,它将具有-1 ;并且没有刻度表示-1。


我在VB中写了这个:


If(East_Checkbox.Value = True)然后

East =" -1"

Else

East =" 1"

结束如果


问题在于,当我开始在记录之间切换时,值保持为前一种方式,因此如果在之前的记录中它有一个勾号,在下一个记录中它也会有它,并且如果在第三个我想要打勾,它也会在其他两个记录中删除它。


是否有任何我可以编写的代码,以便保存值并执行在下一个记录中没有改变?


我试图粘贴我在AfterUpdate中写的相同代码,但它仍然不起作用。


谢谢。

解决方案

看看 https://bytes.com/topic/desktop-soft...-an其他领域


这应该给你一些指示


Phil


你好菲尔


感谢您的链接,我试图改变公式,但没有结果,

请检查图像,如果你看到序列,如果在第三张图片我更改了复选框,在第四张图片上,当我返回上一张记录(记录2)时,即使我没有这样做,也会看到勾选复选框。




我想要实现的是我的复选框保持在我选择的位置,如果下一条记录被更改,则前一条记录不应该改变。


再次感谢您,对不起,我刚开始使用Access。


http://imgur.com/a/zFsVo

Hi Everyone

I am building a small Form that links some information with some checkbox, it means, that when I have a TRUE value in the file, this action will trigger that another field, located in a table that was brought into a query, will be overwrite with a text "-1"

so when I tick it, it will have "-1" and no tick means "-1".

I wrote this in VB:

If (East_Checkbox.Value = True) Then
East = "-1"
Else
East = "1"
End If

The problem is that when I start changing between records, the value stays as the previous way, so if in the previous record it had a tick, in the next one it will also have it, and if in the third one I want to take the tick, it will also remove it in the other two records.

Is there any code I can write so that the value gets saved and do not changed in the next records?

I tried to paste the same code I wrote in the AfterUpdate but still it does not work.

Thank you.

解决方案

Have a look at https://bytes.com/topic/desktop-soft...-another-field

That should give you some pointers

Phil


Hi Phil

Thanks for the link, I tried to change the formula but with no result,
please check the image, if you see the sequence, if on the 3rd image I change the checkboxes, on the fourth image, when I return to the previous record (record 2) you see that the checkbox is ticked even though I did not do it.



What I would like to achieve is that my checkboxes stay in the position that I selected, and if the next record is changed, the previous should not change.

Thank you again, and sorry I am just starting with Access.


http://imgur.com/a/zFsVo


这篇关于复选框会更改所有记录,但不会保留相同的选择。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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