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:
It should not be a problem so it's even more annoying. Thanks to anyone who can help me!
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:
Code:
Private Sub LoadPPM_Click() DoCmd.OpenReport "PPM-Report", acViewPreview, , "[ProjectID] = " & Me!ID And "[ReportDate] = #" & Me!Subform2.Form!Date & "#" End Sub
Comment