Accesing records from different tables
Hi, i'm building a program for a clinic and i want to implement a notification system(email and sms) for appointments. I was thinking to use an on timer script(around 10-30 minutes) that will check an event table for records that have the current date. Every 30 min i want the program to send a notification to the client/doctor if he has an appointment later(if he was already notified that day, it doesn't send another). I'm using a loop system to check every record from that table that matches the conditions, so that is implemented and works as it should....problem is that it works only when i am in a layout connected to the Event table. As the program has over 15 tables and 100 layouts and hundreds of events a month, i don't want to force the program to go to the respective layout and parse the event table as it will mess up with what the user is doing in that precise moment on the layout he is. I am looking for a solution to be able to access the table from anywhere. I have tried with getnthrecord but it doesn't work when i am on a different table(even those that have a relation directly with the event table). As i need information from several fields for each record(like date, start hour,patient name, doctor name, event summary, control variable for events that were sent already), i can''t use summary fields. I am really at lost how to access information from those records without being physically on that table.