I have a report to which I want to change the recordset that feeds it from VBA, so from the form of the button that feeds it, I select a query called OTaller and I add it to the records that have certain Id
filtro = "SELECT OTaller.*"
filtro = filtro & " FROM OTaller"
filtro = filtro & " WHERE Id=" & Me!Id.Value
Then, I open the report. So:
DoCmd.OpenReport "ordentallerSobre", acViewPreview, , filtro
The result is an error. What I would like is that the report will only show the OTaller records that have that Id, but nothing else. Any ideas?