Automatic rostering (1 Viewer)

stevekos07

Registered User.
Local time
Yesterday, 21:55
Joined
Jul 26, 2015
Messages
174
I have a staff roster that I would like to add a feature that will allow the user to roster a member on a regular basis, either weekly, every 2 weeks, once every 4 weeks etc. as well as the option I have now for selecting the next roster date. I would like to have a combobox with options labelled as such. What code would I need to enter the staff ID into a table with a date/time entry set at various ranges according to the option selected? (I hope I am making myself clear).

Would it be as simple as applying an expression to each option (e.g. Date()+7 for one, +14 for another etc.)?

I am thinking maybe a Select Case in VBA. Am I on the right track? How would I write the code?

Table: tblStaffRoster
Field: NextRosterDate
 

Minty

AWF VIP
Local time
Today, 05:55
Joined
Jul 26, 2013
Messages
10,371
If you create a small table for the roster descriptions, and the number of days to add, you could include that days as a hidden column in the combo and refer directly to that.

So if this was on a form, in the after update of the combo your code would be as simple as;

NewRosterDate = Dateadd("d",Me.YourCombo.Column(1),Me.YourExistingDate )

Combo column number starts at 0 so 1 would be the second column.
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 05:55
Joined
Jan 14, 2017
Messages
18,216
Adding to what Minty suggested, after adding all likely values in the combo, I would also add a further combo box item
"Other (specify)"

If users click on that an input box could be used to specify the interval and then use similar code to work out the next roster date
 

stevekos07

Registered User.
Local time
Yesterday, 21:55
Joined
Jul 26, 2015
Messages
174
Thanks for that. Very helpful. I am thinking another option might be the number of repeats. For example have a small table with a range of options between 1 and what ever number is practical, and by selecting this, the after update will apply that selection to add the person to the roster that many times. Perhaps some help with the code for that would be appreciated.
 

Minty

AWF VIP
Local time
Today, 05:55
Joined
Jul 26, 2013
Messages
10,371
What have you currently got / tried ? You would need a simple loop to set up the insert.
 

Users who are viewing this thread

Top Bottom