限制表单或表中值的选择 [英] Limiting Selections for Values in a Form or Table

查看:93
本文介绍了限制表单或表中值的选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我来这个论坛已经有几个星期了解我遇到的问题的解决方案,我不知道如果有一个简单的解决方案。我已经和Access一起工作了一段时间,但只有基础知识,我对VBA知之甚少,但我正在努力教自己,所以请原谅我,如果这没什么意义的话。


我正在写一个卡车调度程序,我试图根据记录中的先前条目限制表格/表格中的选择。


字段是项目(文本) ,工作日期(日期/时间),VendorID(文本),

TruckTyp(文本),TruckNo(文本)。


TuckTyp,VendorID和TruckNo所有引用都返回到单独的查找表。但是,它们都是通过关系加入的。 TruckTyp和TruckNo在VendorID的表格中。


我想要做的是卡车类型根据供应商ID限制其选择。然后让TruckNo根据VendorID和TruckTyp限制自己。


我已经通过操纵查找条件得到了接近,但我似乎找不到通过的方法TruckTyp搜索的VendorID,或者当我这样做时,它将获取输入的第一个值,并将其保存在整个表中,除非您关闭并重新启动应用程序。


感谢advace for你的帮助。

Hi,

I''ve been coming to this forum for a couple of weeks looking for a solution to a problem I''m having, and don''t know if there is an easy solution. I''ve worked with Access for a while, but only the basics, and I know very little about VBA, but I am trying to teach myself, so pardon me if this makes little sense.

I am writing a truck dispatch program, and I am trying to limit selections in a table/form based on earlier entries in the record.

The fields are Project (Text), Work Date (Date/Time), VendorID (Text),
TruckTyp (Text), TruckNo (Text).

The TuckTyp, VendorID, and TruckNo all references back to seperate lookup tables. However, they are all joined by relationships. The TruckTyp and TruckNo are in a table with the VendorID.

What I am trying to do have the truck type limit its choices based upon the Vendor ID. And then have the TruckNo limit itself based on the VendorID and the TruckTyp.

I have gotten close by manipulating the lookup criteria, but I can''t seem to find a way to pass the VendorID to the TruckTyp search, or when I do it takes the first value entered and holds it throughout the whole table, unless you shut down and restart the application.

Thanks in advace for your help.

推荐答案

这个问题可以通过多种方式解决。

我个人更喜欢指导我的用户使用正确的 - 点击弹出菜单。

这将允许他们根据自己的喜好对数据表子表单进行过滤和排序,并节省编写代码的工作量。


其他选项是使用级联组合框,其中下的源是低的。 combobox有一个WHERE,指的是更高组合的表单控件的名称。


最后你可以编写代码来自己构建数据表子表单的过滤器。


Nic; o)
This problem can be solved in a number of ways.
Personally I prefer to instruct my users to use the right-click popup menu.
This will allow them to filter and sort a datasheet subform as they like and saves me the effort of writing code.

The other option is to use cascading comboboxes where the source of the "lower" combobox has a WHERE referring to the name of the form control of the higher combo.

Finally you could write code to build the filter for the datasheet subform yourself.

Nic;o)


谢谢。


我一直在努力工作,但它从来没有做得很好。但是现在我知道我正朝着正确的方向努力,我可以把它搞清楚。
Thank You.

I had been working along those lines, but it never worked quite right. But now that I know I am working in the right direction, I can get it figured out.


让我知道当你遇到困难时我在哪个方向工作我会帮助你。


成功!


Nic; o)
Just let me know which direction you''re working in when you get stuck and I''ll help you further.

Success !

Nic;o)


这篇关于限制表单或表中值的选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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