VBA代码帮助 [英] VBA Code Help

查看:84
本文介绍了VBA代码帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早安小组,

我是VBA编码的新手并且有一个问题。我正在构建一个包含多个记录的数据库,这些记录都包含特定的单个代码我已创建它以返回表中的新可用代码,但这是我的问题。我有2个复选框。第一个复选框是使用中的复选框,第二个是使用的复选框。我想隐藏使用中的复选框,我希望系统在拉动记录时检查或启用此复选框。我是怎么做到的?


提前谢谢。

解决方案


第一个复选框是使用中的复选框,第二个是使用的复选框。我想隐藏使用中的复选框,我希望系统在拉动记录时检查或启用此复选框。



有几种方法可以实现这一目标。一种方法是设置使用中。复选框可见属性为False。接下来,将您要查找的记录放入文本框控件中,然后将IF语句添加到该控件的OnChange事件(如果由表/查询填充)。如果文本框由用户填充,则使用OnExit事件。


类似于:

展开 | 选择 | 换行 | 行号



有几种方法可以实现这一点。一种方法是设置使用中。复选框可见属性为False。接下来,将您要查找的记录放入文本框控件中,然后将IF语句添加到该控件的OnChange事件(如果由表/查询填充)。如果文本框由用户填充,则使用OnExit事件。


类似于:

展开 | 选择 | 换行 | 行号

< br>


感谢您的回复。由于你的建议,我确实弄明白了如何隐藏复选框。我现在遇到的问题是:

当用户选择表单时,我会使用该表填充当前未使用的表中的下一个可用记录。我想要自动启用的复选框的字段称为InUse。不,我想要做的是每次拉出特定记录时我都希望InUse复选框启用这种方式,下一个用户可以在线下拉下一条记录,依此类推。我的代码将如何查找?提前致谢。



您需要做的是放入FORM CURRENT子程序:

展开 | 选择 | Wrap | 行号

Good Morning Group,
I am new to VBA coding and had a question. I am building a database that contains several records that all contain specific individual codes. I have created it to return the new available code in the table but here is my problem. I have 2 check boxes. The first check box is an in use checkbox and the second is a used. I want to hide the in use checkbox and I want this checkbox to be checked or enabled by the system when the record is pulled. How do i do this?

Thanks in advance.

解决方案

The first check box is an in use checkbox and the second is a used. I want to hide the in use checkbox and I want this checkbox to be checked or enabled by the system when the record is pulled.

There are a few ways of accomplishing this. One way is to set the "in use" checkbox visible property to False. Next, place the record your looking for into a textbox control then, add an IF statement to the OnChange event of that control if populated by a table/query. If the textbox is populated by a user then use the OnExit event.

Something like:

Expand|Select|Wrap|Line Numbers


There are a few ways of accomplishing this. One way is to set the "in use" checkbox visible property to False. Next, place the record your looking for into a textbox control then, add an IF statement to the OnChange event of that control if populated by a table/query. If the textbox is populated by a user then use the OnExit event.

Something like:

Expand|Select|Wrap|Line Numbers


Thank you for your response. I did figure out how to hide the checkbox thanks to your suggestion. The issue I am now having is:
When the users selects the form I have it populate with the next available record in that table that is currently not in use. The field for the checkbox i want to automactically enable is called InUse. No what I am trying to do is everytime the specific record is pulled I want the InUse checkbox to enable that way the next user can pull the next record in line and so on and so forth. How would my code look for this? Thanks in advance.

What your going to need to do is put into the FORM CURRENT subroutine:

Expand|Select|Wrap|Line Numbers


这篇关于VBA代码帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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