Go Back   Access World Forums > Microsoft Access Discussion > Tables

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 06-26-2019, 03:24 AM   #1
Chumpalot
Newly Registered User
 
Join Date: Mar 2015
Posts: 68
Thanks: 28
Thanked 7 Times in 7 Posts
Chumpalot is on a distinguished road
Dynamic toggle buttons to control values in a single table

Hi all,

I will try and keep this as succinct and to the point as I can, more for my own sanity and to save me getting confused and ultimately rambling.

I am trying to create what is essentially a sort of diary system in Access (2016). I know this isn't ideal and I should probably explore some sort of integration with Outlook but for now I'd like to contain it all within Access.

There are 230 countries attending a single event taking place across one day. There are timeslots within this single day that any country can attend from 0600 to midnight. The timeslots are 10 minutes each and a maximum of three countries can attend any one slot.

I have a form that records other ancillary information that isn't important here. This form is dynamic in that it pulls the country value through from a previous selection screen. I am trying to build an Open Table type timeslot selection screen which is essentially a grid with toggle buttons to represent times. These go green when they're clicked and the county value is stored into a textbox which I was going to link back to the timeslot table.

From here I am a little stuck. I am not sure how I should go about recording this in the table. Could it be that the toggle looks for the stored country value and then scans the table for the matching country value and then enters a value into the correct timeslot?

Table design
tbl_timeslots
CountryID
0600
0610
0620
0630
0640
0650
0700
etc
etc

Another issue is then how the timeslots look when opening the form. The ones that have been pressed will need to stay pressed (and green). I guess first things first though (code a little, test a lot etc).

Thank you for any and all help on this.

Regards
David

Chumpalot is offline   Reply With Quote
Old 06-26-2019, 03:55 AM   #2
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 3,665
Thanks: 38
Thanked 891 Times in 874 Posts
theDBguy will become famous soon enough theDBguy will become famous soon enough
Re: Dynamic toggle buttons to control values in a single table

Hi David. None of these make sense to us without seeing it. Can you post some images or a copy of your db?
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
Chumpalot (06-27-2019)
Old 06-26-2019, 10:21 PM   #3
Cronk
Newly Registered User
 
Join Date: Jul 2013
Posts: 2,125
Thanks: 3
Thanked 462 Times in 455 Posts
Cronk will become famous soon enough Cronk will become famous soon enough
Re: Dynamic toggle buttons to control values in a single table

You have a period of 6am to 12 midnight (18 hours) with 6 time slots each hour ie 108 time slots.


If I was designing such a system, I'd probably refer to time slots as SlotID and then have a booking table with EventDate, SlotID and CountryID.



The booking form. I can't see 108 lines being able to be displayed without having to scroll down but maybe buttons to select previous/next lot of 6 hour time slots. As to having a green background to indicate available slots, use conditional formatting based on no allocated country to that control.



You'll also need to be cognizant of the system maximum of 754 controls on a form.

Cronk is offline   Reply With Quote
The Following User Says Thank You to Cronk For This Useful Post:
Chumpalot (06-27-2019)
Old 06-26-2019, 10:49 PM   #4
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,839
Thanks: 107
Thanked 2,665 Times in 2,438 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: Dynamic toggle buttons to control values in a single table

I'd also follow the approach suggested by Cronk.
I have several similar features built in to one of my commercial schools apps and used to organise room bookings, parents evening appointments and event management. The methods used in one or more may help you focus your design. See attached for user guides on two of those features if interested.
Attached Files
File Type: zip ParentAppointments.zip (936.3 KB, 9 views)
File Type: zip Room & Equipment Bookings in SDA.zip (936.3 KB, 9 views)
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
Chumpalot (06-27-2019)
Old 06-27-2019, 01:54 AM   #5
Chumpalot
Newly Registered User
 
Join Date: Mar 2015
Posts: 68
Thanks: 28
Thanked 7 Times in 7 Posts
Chumpalot is on a distinguished road
Re: Dynamic toggle buttons to control values in a single table

Thank you very much for the replies. I will take a look at the attached files and crack on with trying to get this done!

Thanks again.
David
Chumpalot is offline   Reply With Quote
Old 06-27-2019, 01:57 AM   #6
Chumpalot
Newly Registered User
 
Join Date: Mar 2015
Posts: 68
Thanks: 28
Thanked 7 Times in 7 Posts
Chumpalot is on a distinguished road
Re: Dynamic toggle buttons to control values in a single table

Quote:
Originally Posted by Cronk View Post
The booking form. I can't see 108 lines being able to be displayed without having to scroll down but maybe buttons to select previous/next lot of 6 hour time slots. As to having a green background to indicate available slots, use conditional formatting based on no allocated country to that control.

You'll also need to be cognizant of the system maximum of 754 controls on a form.
Indeed. It doesn't look too pretty at the moment and is a little funny on the eyes. I just have a block of 6 x 19 toggle buttons!

I'll keep building.

Cheers
Chumpalot is offline   Reply With Quote
Old 06-27-2019, 02:37 AM   #7
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,168
Thanks: 495
Thanked 904 Times in 856 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Dynamic toggle buttons to control values in a single table

Quote:
Originally Posted by Chumpalot View Post
There are 230 countries
Do you mean counties?

Seeing as there are only around 200 countries recognised in the World at any 1 time! - (Currently 195)



Sent from my Pixel 3a using Tapatalk

__________________
Code:
                 |||||
               @(~‘^‘~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is online now   Reply With Quote
Old 06-27-2019, 02:47 AM   #8
Chumpalot
Newly Registered User
 
Join Date: Mar 2015
Posts: 68
Thanks: 28
Thanked 7 Times in 7 Posts
Chumpalot is on a distinguished road
Re: Dynamic toggle buttons to control values in a single table

Quote:
Originally Posted by Uncle Gizmo View Post
Do you mean counties?

Seeing as there are only around 200 countries recognised in the World at any 1 time! - (Currently 195)



Sent from my Pixel 3a using Tapatalk
Apologies, I should have been a little bit more specific but I didn't think it was relevant.

I do have all of the countries and then there are some other entries added to the list. Organisations and other entities. Essentially they're all one and the same thing for the purposes of the database.
Chumpalot is offline   Reply With Quote
Old 06-27-2019, 05:00 AM   #9
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,168
Thanks: 495
Thanked 904 Times in 856 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Dynamic toggle buttons to control values in a single table

Quote:
Originally Posted by Chumpalot View Post
I didn't think it was relevant.
That depends, it could become very relevant if you use Counties instead of Countries in your VBA Code!
__________________
Code:
                 |||||
               @(~‘^‘~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is online now   Reply With Quote
Old 06-28-2019, 05:37 AM   #10
Chumpalot
Newly Registered User
 
Join Date: Mar 2015
Posts: 68
Thanks: 28
Thanked 7 Times in 7 Posts
Chumpalot is on a distinguished road
Re: Dynamic toggle buttons to control values in a single table

Thanks for the replies all. I now have some of it working. By that I mean I can choose a timeslot using any one of the toggle buttons to essentially assign it to a country. This enters the following values into tbl_allocatedtimeslots:

- The countryID
- The time itself (in text format)

What I would like to do now is query this data on loading the form so that the form knows which toggle buttons to show as being green (allocated).

Any idea at all on how I would go about this?

David
Chumpalot is offline   Reply With Quote
Old 06-28-2019, 06:52 AM   #11
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 3,665
Thanks: 38
Thanked 891 Times in 874 Posts
theDBguy will become famous soon enough theDBguy will become famous soon enough
Re: Dynamic toggle buttons to control values in a single table

Quote:
Originally Posted by Chumpalot View Post
Thanks for the replies all. I now have some of it working. By that I mean I can choose a timeslot using any one of the toggle buttons to essentially assign it to a country. This enters the following values into tbl_allocatedtimeslots:

- The countryID
- The time itself (in text format)

What I would like to do now is query this data on loading the form so that the form knows which toggle buttons to show as being green (allocated).

Any idea at all on how I would go about this?

David
Hi David. You might be able to use DLookup() or DCount() to look up if the time slot is allocated and then change the color to green.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
Chumpalot (07-01-2019)
Old 06-28-2019, 02:26 PM   #12
Cronk
Newly Registered User
 
Join Date: Jul 2013
Posts: 2,125
Thanks: 3
Thanked 462 Times in 455 Posts
Cronk will become famous soon enough Cronk will become famous soon enough
Re: Dynamic toggle buttons to control values in a single table

As I wrote in #3, IMO easiest is to use conditional formatting. Set the condition to Value >"" and the background color of the control to green for this condition.
Cronk is offline   Reply With Quote
The Following User Says Thank You to Cronk For This Useful Post:
Chumpalot (07-01-2019)
Old 07-01-2019, 04:49 AM   #13
Chumpalot
Newly Registered User
 
Join Date: Mar 2015
Posts: 68
Thanks: 28
Thanked 7 Times in 7 Posts
Chumpalot is on a distinguished road
Re: Dynamic toggle buttons to control values in a single table

Sorry Cronk, I didn't see your reply in your original post - thank you.

Chumpalot is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Toggle buttons Sway2119 Modules & VBA 2 03-11-2014 09:34 AM
Form control to combine multiple field values into a single text box brharrii General 2 05-13-2013 06:22 AM
Getting multiple values into a single field by using radio buttons/check boxes Sasith Priyankara Forms 1 09-07-2012 05:39 PM
use of toggle buttons... zym1ne Forms 2 07-25-2003 09:55 PM
Toggle Buttons tnago Forms 7 05-28-2003 04:41 PM




All times are GMT -8. The time now is 07:55 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World