Filter a form based on a crosstab query value

AriannaVV

New Member
Joined
Aug 6, 2017
Messages
34
Office Version
  1. 365
Platform
  1. Windows
Hi everyone. I need help on the following issue, pls.
I have a crosstab query
sql: TRANSFORM Max(qry_Files.FileDateLastModified) AS MaxOfFileDateLastModifiedSELECT qry_Files.FileId, A2018.BranchName
FROM qry_Files LEFT JOIN A2018 ON qry_Files.FileId = A2018.BranchID
GROUP BY qry_Files.FileId, A2018.BranchName
PIVOT qry_Files.StatusFinal;

I created a form based on the query above and now i need to open another form named frm_ReportsOPEN, in specific record depending on a column value of my first form.
On a column value field and on mouse Down event i tried to use the code below:
DoCmd.OpenForm "frm_ReportsOPEN", , "MaxOfFileDateLastModified = #" & Me.Primary & "#"
but it doesn't seem to work. Filter is on and both fields are date fields.

What should I do ?
Thanks u!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
You can test this:
Code:
DoCmd.OpenForm "frm_ReportsOPEN", , "MaxOfFileDateLastModified = #" & Me.Primary & "#"
just use a real date that should work:
Code:
DoCmd.OpenForm "frm_ReportsOPEN", , "MaxOfFileDateLastModified = #10/24/2017#"

If it works, you know the problem is in your calling form, and if it doesn't work you know the problem is in the form you are trying to open (or both forms).
 
Upvote 0

Forum statistics

Threads
1,221,668
Messages
6,161,163
Members
451,687
Latest member
KENNETH ROGERS

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top