传递值以从表单查询条件 [英] pass values to query as criteria from form

查看:87
本文介绍了传递值以从表单查询条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个查询,从日期和日期到表单值的设置工作:

> = [表格]![电子报告查询]![DateFrom]和< = [表格]![电子报告查询]![DateTo]


但是现在我正在尝试添加另一个peramiter来将adition传递到上面,现在它不起作用,我得到了当我运行它时,当我运行标准只是为了状态时,我会运行一个空白表格


表格![电子报告查询]![状态]我也得到一个空白表格,<我想要做的是设置查询标准

> = [表格]![电子报告查询]![DateFrom]和< = [表格]![电子报告查询]![DateTo]和[表格]![电子报告查询]![状态]

当我运行它时,我得到一张空白表

note(表单上的状态字段是表中的[state]值等于


提前感谢您的帮助

I have a query that setting date from and date to from form values works:
>=[forms]![E-Report query]![DateFrom] And <=[forms]![E-Report query]![DateTo]

but now I am trying to add another peramiter to pass in adition to above and now it doesn''t work, I get a blank table when I run it and when i run the criteria just for State by

Forms![E-Report query]![State] I get a blank form as well,
what I''m trying to do is is set criteria of query with
>=[forms]![E-Report query]![DateFrom] And <=[forms]![E-Report query]![DateTo] And [forms]![E-Report query]![State]
and when i run it I get a blank table
note(the state field on the form is what the [state]value in the table equles

thanks for help in advance

推荐答案


我有一个查询,将日期和日期设置为f rom表单值工作:

> = [表格]![电子报告查询]![DateFrom]和< = [表格]![电子报告查询]![DateTo]


但是现在我正在尝试添加另一个peramiter将adition传递到上面,现在它不起作用,当我运行它并且当我运行标准时我得到一张空白表for state by


表格![电子报告查询]![州]我也得到一张空白表格,

我正在尝试是设置查询标准

> = [表格]![电子报告查询]![DateFrom]和< = [表格]![电子报告查询]![DateTo ]和[表格]![电子报告查询]![状态]

当我运行它时,我得到一张空白表格

note(表格上的州字段)表中的[state]值等于


感谢您提前获得帮助
I have a query that setting date from and date to from form values works:
>=[forms]![E-Report query]![DateFrom] And <=[forms]![E-Report query]![DateTo]

but now I am trying to add another peramiter to pass in adition to above and now it doesn''t work, I get a blank table when I run it and when i run the criteria just for State by

Forms![E-Report query]![State] I get a blank form as well,
what I''m trying to do is is set criteria of query with
>=[forms]![E-Report query]![DateFrom] And <=[forms]![E-Report query]![DateTo] And [forms]![E-Report query]![State]
and when i run it I get a blank table
note(the state field on the form is what the [state]value in the table equles

thanks for help in advance



好​​吧我想出来但是这样做的目的是循环从查询发送电子邮件。

当我循环填充我的收件人是有一个指定只使用不同的电子邮件地址的方式直到.EOF

即:我使用发送对象方法发送我的电子邮件和SendTo为我的收件人字段

所以当我发送在我的循环中,我的SendTo将是SendTo = sendTo& .fields(电子邮件),但就像我说的几行一样,我如何在这个循环中说明SendTo = Sendto& .fields(电子邮件)但只有不同的电子邮件地址?我猜对了:

SendTo = SendTo& .Distinct fields

求助,thanx提前

OK I figured it out but the purpose of this will be to loop though to send email(s) from the query.
when I loop though to populate my recipients is there a way to specify to only use distinct email address until .EOF
Ie: Im using send object method to send my email and and SendTo for my recipient field
so when I sent up my loop my SendTo would be SendTo = sendTo & .fields("Email") , but like i said a few lines up how would I state in this loop that SendTo = Sendto &.fields ("Email") but only distinct email address? I''m guesing:
SendTo = SendTo & .Distinct fields
help please , thanx in advance


对不起,但你的问题在清晰度方面缺乏相当多的帮助!请向我们发送您询问的相关代码,并用清晰的语言说明您正在尝试做什么。


问候,

Scott
Excuse me, but your question lacks quite a bit in clarity! Please post for us the relevant code that you are asking about, and state in clear language what it is you are trying to do.

Regards,
Scott



对不起,不过你的问题缺乏清晰度!请向我们发送您询问的相关代码,并用清晰的语言说明您正在尝试做什么。


问候,

Scott
Excuse me, but your question lacks quite a bit in clarity! Please post for us the relevant code that you are asking about, and state in clear language what it is you are trying to do.

Regards,
Scott



ok我有代码打开rst并选择字段

来填充电子邮件,但我如何从第一个中选择不同的电子邮件地址(第一个是查询)。

我现在遇到的问题是当我运行它时,我得到一个错误太过fiew peramiters期望3 (debuger突出显示设置loRst = loDb.OpenRecordset(" QryE-CallReport"))

但是如果查询只包含一个表,则相同的方法可以正常工作,在这种情况下它是两个表,

这里是我在Sql中的查询:

ok I have code to open rst and select fields
to populate an email but how can I select distinct email addresses out of the rst (the rst is a query).
the problem I am having with my query rst now is when I run it I get an error "too fiew peramiters expected 3" (debuger highlights Set loRst = loDb.OpenRecordset("QryE-CallReport") )
but the same method works fine if the query is only comprised of one table , in this case it is two tables,
here is my query in Sql:

展开 | 选择 | Wrap | 行号


这篇关于传递值以从表单查询条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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