错误13在特定ID和日期的OpenReport上键入不匹配 [英] Error 13 Type Mismatch on OpenReport on specific ID and Date

查看:51
本文介绍了错误13在特定ID和日期的OpenReport上键入不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我有一个非常简单的数据库,用于存储项目数据。

我制作了4个表,用于存储项目的各种数据,所有与ProjectID链接,除了收集所有未更改的通用信息的表格外,还有ReportDate。


so:

tbl ProjectList :key =项目ID

tbl ProjectStatus,Project ..,Project ..:keys = ProjectID& ReportDate。


我用存储在各种表中的数据做了一个报告。

在一个表单上,我使用组合框过滤第一个子表单,列出了项目名称。当选择项目时,第二个子表单显示每个ReportDate链接到此项目的记录。我想使用按钮打开关于此特定ProjectID和ReportDate的报告。


我设法打开ProjectID上的报告,但它打开了子窗体中显示的所有日期2.当我将Date条件添加到Where Condition时,它表示我有一个类型不匹配错误。我检查了一切,但没有看到什么是错的。它与我的表结构有关吗? (ReportDate在第一个表中缺少?)


这是我在VBA中的代码:

展开 | 选择 | Wrap | 行号

解决方案

这个怎么样?

展开 | 选择 | 换行 | 行号


< blockquote> @Mario,在And。之后你有一个多余的双引号。


Oups,我的不好。是对Murielle的测试; - )


Hello,

I have a quite simple database where i store project data.
I made 4 tables which store various data on the projects, all linked with the ProjectID and, except for the table which gather all the generic info which do not change, also with the ReportDate.

so:
tbl ProjectList: key = Project ID
tbl ProjectStatus, Project.., Project..: keys=ProjectID & ReportDate.

I made a Report out of data stored in those various tables.
On a form, i used comboboxes to filter a first subform which lists the projects by name. When one selects a project, a second subform shows the record linked to this project per ReportDate. I want to open the report on this specific ProjectID and ReportDate using a button.

I manage to open the report on the ProjectID, but it opens ít for all the dates shown in the subform 2. As fast as i add the Date condition to the Where Condition, it says that i have a type mismatch error. I checked everything but don''t see what''s wrong. Does it have to do with my table structure? (ReportDate missing in the first table?)

Here is my code in VBA:

Expand|Select|Wrap|Line Numbers

解决方案

How about this?

Expand|Select|Wrap|Line Numbers


@Mario, you have an extraneous double quote after the And.


Oups, my bad. Was a test for Murielle ;-)


这篇关于错误13在特定ID和日期的OpenReport上键入不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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