WHERE子句错误消息阻止打印所有记录 [英] WHERE clause error message prevents all records from printing

查看:75
本文介绍了WHERE子句错误消息阻止打印所有记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,


我无法获取我的VBA代码以显示所有记录并允许我


查看已过滤用户输入的响应,一旦我的cmd_click()事件


触发。


该表单以AD HOC形式显示来自数据库的19个字段,使用


连续格式,以便用户可以选择他们想要的字段来过滤。


为了帮助用户,我有两个未绑定的组合框和四个未绑定的文本


框用于用户输入:


节目名称(组合)

来源(文字)

联络(文字)

状态(组合)

到期日期 - 从(文本)

到期日 - 到(文本)


过滤器效果很好。但是,当我按下命令按钮打印预览时,它只显示

报告中的FIRST记录,如下所示。


我意识到我需要告诉我的报告在记录源中要查找什么,但是我在报告表的SQL WHERE子句中遇到了太多错误。我缺少什么?

Hello All,

I am unable to get my VBA code to show all the records and allow me to

view the filtered responses from user input, once my cmd_click() event

fires.

The form displays the 19 fields from database in an AD HOC form, using a

continuous form format so it allows the user to select what fields they want

to filter.

To aid the user, I have two unbound combo boxes and four unbound text

boxes for user input:

Program name (Combo)
Source (Text)
Liaison (Text)
Status (Combo)
Due Date - From (Text)
Due Date - To (Text)

The filter works great. However, it only displays the FIRST record on the
report when I fire the command button to print preview as follows.

I realized that I needed to tell my report what to look for in the record source but I am getting sooo many errors on my SQL WHERE clause of my report table. What am I missing?

展开 | 选择 | Wrap | 行号

推荐答案




我认为你在Like比较中的星号位置有点偏,所以如果你可以试试这个,对于初学者来说,我会有兴趣看看你得到了什么。在某些地方你也有一些人失踪。

Hi,

I think your placement of the asterisks in the Like comparisons is a bit off, so if you could try this, for starters, I''d be interested to see what you get. You also had a couple '' missing in some places.

展开 | 选择 | Wrap | 行号


嘿有Zepphead80,

我想知道如何破译这个错误信息:

recourd source'tblOpenActionItems。[Liaison_Contact_Information] =''" &安培; Me.txtFilterLiaison& "''和tblOpenActionItems。[来源]赞''*' &安培;这个表格或报告中指定的......不存在。


我真的不明白,因为这些是表格中的字段。我也没有看到任何错误直接指向日期中的错误


我还必须提到我的报告的字段指向表格中的字段用户直接输入。例如,以下是报告中的日期完成字段来源:

Hey there Zepphead80,

I wonder how to decipher this error message:

The recourd source ‘tblOpenActionItems.[Liaison_Contact_Information] = ''" & Me.txtFilterLiaison & "'' AND tblOpenActionItems.[Source] Like ''*" & …’specified on this form or report does not exist.

I truly do not understand as these are the fields from the form. I also do not see anything in the error that points directly to an error in the date

I must also mention that my report''s fields point back to the fields from the form where the user makes direct input. For example, here is the Date Complete field source in the report:

展开 | 选择 | Wrap | 行号


有问题您将字符串放在一起以形成整个SQL查询的方式。你可以发布更多的代码,以便我可以看到SQL字符串的实际分配吗?


Pat
There is a problem with the way you are putting the string together to form the whole SQL query. Can you post more of the code so that I can see the actually assignment of the SQL string?

Pat


这篇关于WHERE子句错误消息阻止打印所有记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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