Hi,
It should be simple … may be too simple but …
I have a warehouse application which can manage several warehouses. Each user may however manage only one warehouse.
When the application starts, it reads the warehouseid in a parameter table and stores it into a VBA public variable (mywarehouse) for later use.
My problem is to reuse this variable as a where condition in the underlying query (warehouseid = mywarehouse) every time I open a form or a report, so that the user can only see what’s related to his warehouse.
I mean with « underlying query » : a saved query with a title that you can see in the database bindow.
I could embed the underlying queries as SQL statements, with the warehouse where condition, in every form/report load event, but this is a very heavy solution since I should then convert all underlying queries into embedded SQL statements.
I guess I could do it better otherwise by keeping the underlying queries.
Any idea ?
Thanks
It should be simple … may be too simple but …
I have a warehouse application which can manage several warehouses. Each user may however manage only one warehouse.
When the application starts, it reads the warehouseid in a parameter table and stores it into a VBA public variable (mywarehouse) for later use.
My problem is to reuse this variable as a where condition in the underlying query (warehouseid = mywarehouse) every time I open a form or a report, so that the user can only see what’s related to his warehouse.
I mean with « underlying query » : a saved query with a title that you can see in the database bindow.
I could embed the underlying queries as SQL statements, with the warehouse where condition, in every form/report load event, but this is a very heavy solution since I should then convert all underlying queries into embedded SQL statements.
I guess I could do it better otherwise by keeping the underlying queries.
Any idea ?
Thanks