You need to pass the value of activecontrolparentformname() as a parameter to the stored query.

I'd also recommend that you check out a book called "Microsoft Access Developers' Guide to SQL Server" - I found this invaluable when I was trying to wrap my head around the differences in SQL coming from Access.