question

OBina-6405 avatar image
0 Votes"
OBina-6405 asked saldana-msft edited

Filter Access Report in VB

Hi All,
The below command works pretty well:
DoCmd.OpenReport "Project HSE Management Report", acViewReport, , "[ProjectID] = '002'"

Unfortunately, when I replace the '002' with the actual Form Control (see below), it crashes!!!!

DoCmd.OpenReport "Project HSE Management Report", acViewReport, , "[ProjectID] =" & Me.ProjectID

What could be the problem?

The form is called PROJECTS and sits on a Navigation Control called NAVIGATION PAGE.

office-vba-devmicrosoft-graph-reports
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Viorel-1 avatar image
0 Votes"
Viorel-1 answered Viorel-1 edited

If Me.ProjectID is "002", then try this line:

DoCmd.OpenReport "Project HSE Management Report", acViewReport, , "[ProjectID] = '" & Me.ProjectID & "'"



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.