使用子窗体上的组合框限制字段值 [英] Limit field values with a combobox on a subform

查看:48
本文介绍了使用子窗体上的组合框限制字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!


我有一个问题我已经工作了几天了,我找不到解决方案。我希望有人有答案:)


我在win XP中使用Access 2003。我有一个名为MulitLineView的主窗体,它有一个名为subLinelistView的子窗体。在主要形式'''Form_Open"事件我使用查询来打开表的内容,以便在数据表模式下的子表单中进行编辑,如下所示:

Hello!

I have a question I''ve been working on for a few days now and I can''t find a solution. I hope there is someone that has the answer :)

I''m using Access 2003 in win XP. I have a main form called "MulitLineView", that has a subform called "subLinelistView". In the main form''s "Form_Open" event I use a query to open the contents of a table for editing in the subform in datasheet mode like this:

展开 | 选择 | Wrap | 行号

推荐答案


我的问题是:我如何才能使它对于某些列,可以在字段中输入的值受组合框限制?[/ u]

组合框的行源应该是我想在每列的代码中提供的查询。我一直在努力找到合适的控件属性,我尝试过这样的事情:
My question is: How can I make it so that for some columns, the values which can be entered in the field are limited by a combobox?[/u]
The rowsources for the comboboxes should be queries which I want to provide in the code for each column. I''ve been trying to find the right control property, I tried things like:
展开 | 选择 | Wrap | 行号



尝试这种语法,假设plan_abbr是你的组合框:

看到这个链接:
http://www.mvps.org/access/forms/frm0031.htm

try this syntax, assuming plan_abbr is your combo box:
see this link:
http://www.mvps.org/access/forms/frm0031.htm

展开 | 选择 | Wrap | 行号


什么是Plant_abbr .....文本框?它是在主窗体还是子窗体上?


如果从子窗体执行代码:

更改:

strControlType = Me!subLinelistView.Form![Plant_abbr] .ControlType


对此:

strControlType = Me![Plant_abbr] .ControlType



重新说明:
What is Plant_abbr.....a textbox? and is it on the main form or the subform?

If you are executing your code from the subform:
Change this:
strControlType = Me!subLinelistView.Form![Plant_abbr].ControlType

To this:
strControlType = Me![Plant_abbr].ControlType


And re this:
展开 | 选择 | Wrap | 行号


这篇关于使用子窗体上的组合框限制字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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