Users See own school Data

[TABLE=“border: 0, cellpadding: 4, cellspacing: 1, height: 18”]
[TR]
[TD=“align: left”]Hello

		I have an application consisting of grids and forms for multiple schools, students, staff and infrastructure. When i a user logs in, they should only be able to see data from their own school. The school ID is a foreign key in all tables
		
		how do i achieve this?[/TD]
	[/TR]
 [/TABLE]

Add the schoolid to the user table, so when a user logs in you know which school he belongs to. Apply it to a global variable, i.e. [glob_schoolid]. Then on each and every form/grid etc. where you need to apply this add the following to the sql statement:

and where schoolID=’[glob_schoolid]’

That will filter the right data for the user.

Hello Albert

Thanks for the precise and clear guidance. However, when i implement as stated above. I log in and the user cant see any data.

Is there something i missed? maybe in the select statement?

form.JPG

Grid.JPG

Login App.JPG

Hello Albert

Thanks for the short and concise instructions. However when my user logs in, they see no data.

Am i missing anything in the select statement or anywhere?

form.JPG

Grid.JPG

Login App.JPG

The login is not right since glob_school should be assigned with the school value. It has nothing now.

Hello Albert,

While i understand your response, The login is not right since glob_school should be assigned with the school value. It has nothing now.

I am not sure how to implement it to get my desired results.

Would it be possible to help me re-write my query so that it can function as required?

Thanks a bunch for your time and assistance.

i

How do i implement this? Please give me the syntax

I wrote out my code in the login app as shown in the previous posts, but i seem to miss out something. Albert gave further direction, but i still cant seem to figure it out.

Please assist

@aducom told you. Your fault is you are not assigning to the global app to be used by the others applications.
You miss somethins like:

[whathevernameforyourglobalschoolvar] = {rs[0][2]};

Remember to set [whathevernameforyourglobalschoolvar] to OUT in Global Variables

Thanks for @aducom and @Gui for the very excellent instructions and assistance in fixing this. Its working perfectly fine now. If only paid support could be as helpful.

Stay tuned to next days 8D