Filter values in database

会有一股神秘感。 提交于 2020-01-15 09:44:34

问题


I am looking for someone to explain how to filter a ms-access database by column and display only cells which have higher values than given value from textbox?

Example: If given value in textbox is 3:

Column1
1
2
3
4
5

Filtering...

Column1
4
5 

回答1:


You can refer to a form in a query:

SELECT Column1
FROM ATable
WHERE Column1 > Forms!AForm!txtTextbox

You can also apply a filter to a form, for the current form, you might say:

Private Sub txtTextbox_AfterUpdate()
    Me.Filter = "Column1>" & Me.txtTextbox
    Me.FilterOn = True
End Sub


来源:https://stackoverflow.com/questions/14725470/filter-values-in-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!