so your query needs to know about the current main forms ID. There are many ways to do this. For me, I would create a global variable, e.g. public glng_MAIN_ID as long into a Public module then I would create a GET function so that the query can just run the function and collect the ID...