因此,前几天我发布了一个关于访问表单的问题,该表单需要在2个框中添加一个“全选”选项。我可以使用一个并集将选项添加到其中的两个。然而,这些选项到目前为止还没有起到任何作用。我找到了一个从组合框中获取表单参数的查询,在这里我需要添加selectall选项,只是在盯着它看了几个小时之后我又没有任何线索了。
数据库不是我写的,它大约有10年的历史了,是给我添加一些新功能的。我这样做了,店主抱怨说“全选”按钮从来没用过。经过研究,按钮有vb脚本,清除组合框输入为空值。我计划取消这些现在,因为我已经添加了选项组合框本身。
读取组合输入的sql查询如下所示:
PARAMETERS [Forms]![ReportCentre]![cboTreatmentType] Short, [Forms]![ReportCentre]! [cboTreatmentDate] Short;
SELECT addresses.*,
[firstname] & "" & [lastname]
AS Name,
[street] & "," & [suburb] & "" & [stateorprovince] & "" & [postalcode]
AS
Address
FROM addresses
WHERE ( ( ( addresses.treatmentid ) = [forms] ! [reportcentre] !
[cbotreatmenttype].[Value] )
AND ( ( addresses.treatmentdate ) = [forms] ! [reportcentre] !
[cbotreatmentdate].[Value] )
AND ( ( addresses.birthmonth ) LIKE [forms] ! [reportcentre] !
[txtbirthmonth].[Value]
& "*" ) )
OR ( ( ( addresses.treatmentid ) IS NULL )
AND
( ( addresses.treatmentdate ) = [forms] ! [reportcentre] !
[cbotreatmentdate].[Value] )
AND ( ( addresses.birthmonth ) LIKE [forms] ! [reportcentre] !
[txtbirthmonth].[Value]
& "*" ) )
OR ( ( ( addresses.treatmentid ) = [forms] ! [reportcentre] !
[cbotreatmenttype].[Value] )
AND ( ( addresses.treatmentdate ) IS NULL )
AND ( ( addresses.birthmonth ) LIKE [forms] ! [reportcentre] !
[txtbirthmonth].[Value]
& "*" ) )
OR ( ( ( addresses.treatmentid ) IS NULL )
AND ( ( addresses.treatmentdate ) IS NULL )
AND ( ( addresses.birthmonth ) LIKE [forms] ! [reportcentre] !
[txtbirthmonth].[Value]
& "*" ) )
OR ( ( ( addresses.treatmentid ) IS NULL )
AND
( ( addresses.treatmentdate ) = [forms] ! [reportcentre] !
[cbotreatmentdate].[Value] )
AND ( ( addresses.birthmonth ) IS NULL ) )
OR ( ( ( addresses.treatmentid ) = [forms] ! [reportcentre] !
[cbotreatmenttype].[Value] )
AND ( ( addresses.treatmentdate ) IS NULL )
AND ( ( addresses.birthmonth ) IS NULL ) )
OR ( ( ( addresses.treatmentid ) = [forms] ! [reportcentre] !
[cbotreatmenttype].[Value] )
AND
( ( addresses.treatmentdate ) = [forms] ! [reportcentre] !
[cbotreatmentdate].[Value] )
AND ( ( addresses.birthmonth ) IS NULL ) );
我知道这很混乱,很难理解,这就是为什么我要寻求帮助。我如何得到它来验证两个组合框的“全选”选项?
1条答案
按热度按时间6kkfgxo01#
一种非常简单的方法是将组合的绑定列设置为*:
使用您的组合:
然后您可以使用:
使用sql:
如果只有一列,则可以使用: