创建公共功能 - Access 2003,XP OS [英] create public function - Access 2003, XP OS

查看:77
本文介绍了创建公共功能 - Access 2003,XP OS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,专业人士......我在表格上喜欢80个矩形,我想要像复选框一样。我已经弄清楚当填充与矩形对应的列表框值时如何使它们出现/消失。我还想出了如何改变盒子的颜色,具体取决于实际和实际。相应的复选框相应地设置为true / false ...


现在问题是,我不想复制每个盒子的代码。有没有办法让它运行取决于我选择的矩形框?我在这里感到茫然,非常感谢任何帮助......在此先感谢。


这就是我所拥有的用于将值设置为listbox rowid然后更改的内容矩形的颜色表示真或假...

Ok, pros... I have like 80 rectangles on a form that i want to kinda act like check boxes. I have already figured out how to get them to appear/dissappear when the list box value that corresponds to the rectangle is populated or not. I have also figured out how to change the color of the box depending on if the "Actual" corresponding check box is set true/false accordingly...

Now the problem, I don''t want to have to replicate the code for EVERY box. Is there a way to get this to run depending on which rectangle box I select? I am at a loss here and would appreciate any help... thanks in advance.

Here''s what I have that works for setting the value to the listbox rowid and then changing the color of the rectangle to represent true or false...

展开 | 选择 | Wrap | 行号

推荐答案


好​​的,专业...我在表格上有80个矩形,我想要像复选框一样。我已经弄清楚当填充与矩形对应的列表框值时如何使它们出现/消失。我还想出了如何改变盒子的颜色,具体取决于实际和实际。相应的复选框相应地设置为true / false ...


现在问题是,我不想复制每个盒子的代码。有没有办法让它运行取决于我选择的矩形框?我在这里感到茫然,非常感谢任何帮助......在此先感谢。


这就是我所拥有的用于将值设置为listbox rowid然后更改的内容矩形的颜色表示真或假...

Ok, pros... I have like 80 rectangles on a form that i want to kinda act like check boxes. I have already figured out how to get them to appear/dissappear when the list box value that corresponds to the rectangle is populated or not. I have also figured out how to change the color of the box depending on if the "Actual" corresponding check box is set true/false accordingly...

Now the problem, I don''t want to have to replicate the code for EVERY box. Is there a way to get this to run depending on which rectangle box I select? I am at a loss here and would appreciate any help... thanks in advance.

Here''s what I have that works for setting the value to the listbox rowid and then changing the color of the rectangle to represent true or false...

展开 | 选择 | Wrap | 行号



我发现你的请求非常混乱,但我会尝试至少指出你正确的方向。
I find your request very confusing, but I''ll make an attempt to at least point you in the right direction.



对不起,关于混乱...我很新闻,我还在努力理解语言...如果你知道我的意思。 />

基本上,我的数据库的这种特殊形式是:

我可以添加每月费用/账单以及查看/编辑此表格通过列表框选择......够简单。总共有四个列表框,分别为第一个账单,第一笔费用,第15个账单和第15个费用。那部分我下来了,没有数据选择问题和列表框的数量......一切都很好。


第二部分,这是混乱的领域是这样的:

SCENARIO ..有1个表,其中一个字段被命名为付费。这是真/假。表单有4个列表框。我们将专注于Listbox1。为了便于讨论,Lets说我只有1条记录。


好​​的,现在......


我创建了56个矩形,红色,并与各个列表框行对齐。当Rectangle1时代表付费的分配给listbox1.row0的记录的列被点击,它将改变RECTANGLE的背景颜色。到绿色,然后更新记录以设置付费 value = true。


我已经使用原帖中的代码成功完成了此操作。但是,我不想在表单上为每个矩形重复该代码。我想知道是否有办法创建一个全局类型的函数来解决这个函数?我希望这能把它清理一下。再次,我感谢你的时间,并为任何困惑道歉。

Sorry, about the confusion... I am quite the newb, and am still trying to understand the language... if you know what I mean.

Basically, what this particular form of my DB is for is this:
I am able to add monthly expenses/bills as well as view/edit from this form via listbox selection... simple enough. There are a total of Four listboxes one for 1st Bills, 1st Expenses, 15th Bills and 15th Expenses resepectively. That part I got down and don''t have an issue with data selection and population of the listboxes... all good there.

The second part, which is the area of confusion is this:

SCENARIO.. There is 1 table, and one of the fields are named "Paid" which is true/false. The form, has 4 listboxes. We will concentrate on Listbox1. For the sake of discussion, Lets says I only have 1 record.

Ok, now...

I created 56 rectangles, colored RED, and lined them up with the individual listbox rows. When "Rectangle1" which represents the "paid" column of the record assigned to listbox1.row0 is "clicked", it will change the background color of the "RECTANGLE" to GREEN which in turn updates the record to set "paid" value = true.

I have successfully pulled this off using the code in the original post. However, I don''t want to have to repeat that code for EACH rectangle on the form. I am wondering if there is a way to create a global-type function that will resolve this function for me? I hope this cleared it up a little. Again, I thank you for your time and appologize for any confusion.



对不起,关于混乱...我很新,我仍在努力理解这种语言...如果你知道我的意思。


基本上,我的数据库的这种特殊形式是:

我可以通过列表框选择添加每月费用/账单以及从此表单查看/编辑......简单。总共有四个列表框,分别为第一个账单,第一笔费用,第15个账单和第15个费用。那部分我下来了,没有数据选择问题和列表框的数量......一切都很好。


第二部分,这是混乱的领域是这样的:

SCENARIO ..有1个表,其中一个字段被命名为付费。这是真/假。表单有4个列表框。我们将专注于Listbox1。为了便于讨论,Lets说我只有1条记录。


好​​的,现在......


我创建了56个矩形,红色,并与各个列表框行对齐。当Rectangle1时代表付费的分配给listbox1.row0的记录的列被点击,它将改变RECTANGLE的背景颜色。到绿色,然后更新记录以设置付费 value = true。


我已经使用原帖中的代码成功完成了此操作。但是,我不想在表单上为每个矩形重复该代码。我想知道是否有办法创建一个全局类型的函数来解决这个函数?我希望这能把它清理一下。我再次感谢你的时间,并为任何困惑道歉。
Sorry, about the confusion... I am quite the newb, and am still trying to understand the language... if you know what I mean.

Basically, what this particular form of my DB is for is this:
I am able to add monthly expenses/bills as well as view/edit from this form via listbox selection... simple enough. There are a total of Four listboxes one for 1st Bills, 1st Expenses, 15th Bills and 15th Expenses resepectively. That part I got down and don''t have an issue with data selection and population of the listboxes... all good there.

The second part, which is the area of confusion is this:

SCENARIO.. There is 1 table, and one of the fields are named "Paid" which is true/false. The form, has 4 listboxes. We will concentrate on Listbox1. For the sake of discussion, Lets says I only have 1 record.

Ok, now...

I created 56 rectangles, colored RED, and lined them up with the individual listbox rows. When "Rectangle1" which represents the "paid" column of the record assigned to listbox1.row0 is "clicked", it will change the background color of the "RECTANGLE" to GREEN which in turn updates the record to set "paid" value = true.

I have successfully pulled this off using the code in the original post. However, I don''t want to have to repeat that code for EACH rectangle on the form. I am wondering if there is a way to create a global-type function that will resolve this function for me? I hope this cleared it up a little. Again, I thank you for your time and appologize for any confusion.



感谢您的解释,一些雾实际上已经解除了。应该有一种相当有效的方法来实现这一目标。我会看到我以后可以提出的。

Thanks for the explanation, some of the fog has actually lifted. There should be a fairly and more efficient way to accomplish this. I''ll see what I can come up with later on.


这篇关于创建公共功能 - Access 2003,XP OS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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