I want to go to a layout based on the time of day
For example if it is 8:04 AM or later but not yet 9:03 I want it to go to Layout a
If it is 9:03 but not yet 10:02 or later I want it to go to layout B
Go to the layout from where? A different layout? When you open the file? Do you want the solution to just automatically switch layouts when the current specified interval ends?
It can be done, but the details of what you want make a big difference in implementation.
And what is different with each of these layouts that requires this change of layouts? (maybe there's another simpler way that avoids the need for all of these different layouts....)
I would be going from a layout in find mode and when a person enters their code it would take them to a layout.
For example if a student enters their ID it will add them as present to the class period they should currently be in by going to that layout and changing the status field to present.
There are 9 layouts for the nine different periods
What are the differences between these 9 layouts?
Seems like a complicated way to do things. Are you basing the nine layouts on nine different tables or TO's? If so, is there a particular reason for breaking out each period into it's own like that? You could add a field that indicates which period you're capturing data for, and simply set that field based on the time.
To answer the specific question, if you do this via script, there's a pair of options possible with the Go To Layout script step that can take the user to different layouts. Either the "layout name by calculation" or the "layout number by calculation" options might be used.
But as others have commented, this seems a needless complication of your design and may indicate a need for a better underlying data model for your solution.
What the end result would be to log a student into a particular period of the day depending on the time of day which could be done by pointing to a particular layout depending on the time of day which would only have related data for the time period in quesiton
Ok, but what you describe does not require using multiple layouts. A single layout for this task should work. This, in turn, makes for a solution that will have a much simpler design that will be easier for you to maintain and modify.
So please describe the tables and relationships that you are using that thus require this approach. We can then give you an immediate fix for your current design and also map out for you a better approach that you can transition to.
Retrieving data ...