如何通过VBA程序过滤子表单中的表? [英] How to Filter the table in a subform via VBA Program?

查看:85
本文介绍了如何通过VBA程序过滤子表单中的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个subForm,其源对象被分配到一个表。



在表单上加载我需要这个表以一种方式过滤,它应该只显示特定列中没有空值的行。



但后来它会让人感到惊讶用户更改过滤器以使用列名称中的过滤器图标查看所有值。



任何人都可以帮我提供此代码...



先谢谢

Hi,

I have a subForm whose source object is assigned to a table.

On form Load i need this table to filter in a manner that it should show only the rows which has no null values in a particular column .

But later it shouls allow the user to change the filter to view all values using the filter icon in the column name.

Can any one help me with a code for this...

Thanks in advance

推荐答案

我能解决问题。

这就是我所做的。



我去了桌子设计查看并打开了表格属性表。



这里的FilterBy选项我给出了我需要的标准。



然后在FilterOnLoad选项中我给了Yes。



现在,当我的表单加载时,带有表作为源的子表单现在打开,带有过滤的值。用户也可以删除t如果他愿意,他会过滤。



谢谢。:)
I was able to fix the Issue.
this is what i did.

I went to the table design View and opened the Table properties sheet.

Here in the "FilterBy" option i gave the criteria i needed.

Then in the "FilterOnLoad" option i gave Yes.

Now when my Form loads,the Subform with the table as source now opens with the filtered value.and user can also remove the filter if he wants.

Thanks.:)


这篇关于如何通过VBA程序过滤子表单中的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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