Im trying to make openreport button that selects a number of records from one table based on a compare in another. I have made an sql call in query mode that gives me the records that I want to make a report from, but I cannot convert it to vba. any pointer, solutions or heads-up are welcome
DoCmd.OpenReport strDocName, acViewPreview, , "SELECT support.SerieNr FROM support WHERE support.SerieNr IN (SELECT SerieNr FROM IT_tilmeld WHERE AfdNr = " & test)
I get a compile error when I use (), and no errors without, but the statement will not work...