问题描述
我有一个包含6个选择字段的大型查询,我允许用户从1个单一输入表单中选择任何一个。
Form SearchForm上的6个选项字段为:Track ,Distance,Surface,Track_Condition,Final_Pos和Race_Type。 6个特定的组合框是cboTrack,cboDistance,cboSurface,cboTrkCond,cboFinalPos和cboRaceType。
我已经设置了一个查询/过滤器,使用选择标准[Forms]![SearchForm]![cboTrack]等...以交替方式设置,以便任意组合在6个组合框中,将数据过滤到所选择的内容。这完全符合我的预期。
我的问题是,我希望允许用户选择与FinalPos组合框一起选择运算符选项<,< =,=,>,> =与cboFinalPos输入一起使得理论上他们可以说< 3并过滤除位置1和1之外的所有数据。 2 ...依此类推。
我在这一点上的努力是创建一个名为cboOperators的新组合框,但我在获取现有查询时遇到了困难上班。我尝试在过滤器查询的Final_Pos字段中放置代码[Forms]![SearchForm]![cboOperators] [Forms]![SearchForm]![cboFinishPos],希望如果用户选择<< ",Access将其读作< [cboFinishPos]并相应地过滤。错误是您输入的表达式包含无效语法。你可能已经输入了一个没有操作员的操作数。
首先我想做什么,如果是的话,我做错了什么?
I have a large query with 6 selection fields that I allow the user to choose any and all from 1 single input form.
The 6 option fields on Form SearchForm are: Track, Distance, Surface, Track_Condition, Final_Pos and Race_Type. The 6 particular combo boxes are cboTrack, cboDistance, cboSurface, cboTrkCond, cboFinalPos and cboRaceType.
I''ve set up a query/filter that works using the selection criteria [Forms]![SearchForm]![cboTrack]etc... in alternating manners so that any combination of the 6 combo-boxes will filter the data to exactly what is chosen. This works exactly how I wish it to.
My question is, I wish to allow the user to select in conjunction with the FinalPos combo-box, an operator option <, <=, =, >, >= along with the cboFinalPos input so that in theory, they could say < 3 and filter out all data except Positions 1 & 2...and so on and so forth.
My effort at this point has been to create a new combo-box entitled cboOperators but I am running into difficulty in getting the existing query to work. I attempted, in the Final_Pos field of the filter query, to place the code [Forms]![SearchForm]![cboOperators][Forms]![SearchForm]![cboFinishPos] in, hoping that if the user selected "<", Access would read it as <[cboFinishPos] and filter accordingly. The error is "The Expression You Entered Contains Invalid Syntax. You may have entered an operand without an operator."
Is what I''m trying to do possible first off and if so, what am I doing wrong?
推荐答案
这篇关于有没有办法允许用户选择组合框的比较选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!