By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

Representing time slots on a sub form

100+
P: 121
Hi,

I have an equipment booking database the idea is that you book a list of equipment to a scheduled session I have a main form that displays the details for a session, date time location etc..

In that form I have a sub form that displays booked equipment related to that session. When a user attempts to book a piece of equipment a check is run on that piece of equipment to see if it is already booked elsewhere.

To represent this graphically I have created green rectangles on the sub form each representing an hours time slot so rectangle 1 = 09:00 - 10:00 rectangle 2= 10:00 - 11:00 etc when the check is run and if the equipment is booked it changes the rectangles from green to red,

I currently have this working by setting my sub form to continuous forms which lists the equipment that is related to the scheduled session but because the rectangles are not related to the individual equipment record in the detail section of the form when the change in colour on the rectangle box is applied it changes the colour for all equipment records.

So for example a user attempts to book equipment1 which is already booked from 09:00-12:00 and the next equipment record equipment 2 is booked from 17:00 - 19:00 I want to be able to show that both these pieces of equipment are booked at different times.

I think I will be able to do it if a set the sub form to single form view and create say 20 rows of fields and rectangles but that will restrict me to 20 records on the form where as if I set the sub form to continuous forms I can have any number of records....

Hope this makes some sense

Please help

Regards Phill
May 18 '08 #1
Share this Question
Share on Google+
4 Replies


puppydogbuddy
Expert 100+
P: 1,923
Hi,

I have an equipment booking database the idea is that you book a list of equipment to a scheduled session I have a main form that displays the details for a session, date time location etc..

In that form I have a sub form that displays booked equipment related to that session. When a user attempts to book a piece of equipment a check is run on that piece of equipment to see if it is already booked elsewhere.

To represent this graphically I have created green rectangles on the sub form each representing an hours time slot so rectangle 1 = 09:00 - 10:00 rectangle 2= 10:00 - 11:00 etc when the check is run and if the equipment is booked it changes the rectangles from green to red,

I currently have this working by setting my sub form to continuous forms which lists the equipment that is related to the scheduled session but because the rectangles are not related to the individual equipment record in the detail section of the form when the change in colour on the rectangle box is applied it changes the colour for all equipment records.

So for example a user attempts to book equipment1 which is already booked from 09:00-12:00 and the next equipment record equipment 2 is booked from 17:00 - 19:00 I want to be able to show that both these pieces of equipment are booked at different times.

I think I will be able to do it if a set the sub form to single form view and create say 20 rows of fields and rectangles but that will restrict me to 20 records on the form where as if I set the sub form to continuous forms I can have any number of records....

Hope this makes some sense

Please help

Regards Phill
For performance reasons Microsoft designed controls on a continuous form as single controls with multiple instances. There are several ways that you can address different instances of a single control. One of them is built into Access. It is known as conditional formatting.

Have you tried conditional formatting? That is one way that you can solve your problem. Conditional formatting enables to set formatting properties (including color) for just those instances that meet certain conditions.

To use conditional formatting, place your subform in design view, highlight the control that you want conditional formatting to be applied to, then go to the command menu at the top of your screen. Select Format> conditional formatting.

If you need assistance with setting up the conditional formatting, let us know.
May 18 '08 #2

100+
P: 121
For performance reasons Microsoft designed controls on a continuous form as single controls with multiple instances. There are several ways that you can address different instances of a single control. One of them is built into Access. It is known as conditional formatting.

Have you tried conditional formatting? That is one way that you can solve your problem. Conditional formatting enables to set formatting properties (including color) for just those instances that meet certain conditions.

To use conditional formatting, place your subform in design view, highlight the control that you want conditional formatting to be applied to, then go to the command menu at the top of your screen. Select Format> conditional formatting.

If you need assistance with setting up the conditional formatting, let us know.
hi puppydogbuddy

Thanks for the help but I think you misunderstand my problem I am able to change the colour of the rectangles no problem.

The main form shows the session details location, date, time etc

The sub form shows several pieces of equipment that have been booked to the session in the continuous forms format I want the rectangles that represent the hourly time slots from 09:00 - 24:00 to show whether the selected piece of equipment is already booked somewhere else by changing the colour to red.

So imagine three records showing three different pieces of equipment the user selects what piece of equipment they want to book from a list in the first column the start time in the second column then the end time in the third column. There is a row of green rectangles representing time slots from 09:00-10:00 10:00 -11:00 up until midnight I am able to change the colour of the rectangles no problem but if the colour changes, for example, on the first two boxes 09:00 - 10:00 and 10:00 -11:00 in the row for Equip1 it changes them in all of the columns for Equip2 and Equip3 I want to be able to associate the time slot rectangles to the individual equipment record I have tried to illustrate it below. Is there any way I can send you a picture because I am sure it will make a lot more sense?


Equip1 12:00 15:00_____________09:00-10:00 10:00 -11:00...23:00-24:00
Equip2 14:00 15:00_____________09:00-10:00 10:00 -11:00...23:00-24:00
Equip3 15:00 17:00_____________09:00-10:00 10:00 -11:00...23:00-24:00

Regards Phill
May 19 '08 #3

puppydogbuddy
Expert 100+
P: 1,923
Phill,
I understand your problem andI still believe conditional formatting is the answer because it will only execute the actions (e.g. change the color of those textboxes) that meet the condition you set. Microsoft provided the conditional formatting to address the continuous form problem. try it....if you need help setting the conditions let me know.

PDB
May 19 '08 #4

FishVal
Expert 2.5K+
P: 2,653
Phil.

If you have Access 2007, then you may advantageously use its new feature - Image control having ControlSource property.

Regards,
Fish
May 19 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.