473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Assign task to next person in sequence

I have a form for data entry, and when I create a new record I want the "assigned to" field to auto-populate by choosing the next record in a sequence from a list of people.

For example, every time a certain meeting is set up one representative from my group needs to attend, but it should not always be the same person. When I add a new record for the next meeting, I want the "assign to" field to look at my list of seven possible employees to decide whose turn it is to attend that meeting, and autopopulate the "assign to" field. Kind of like assigning sales leads equally, but I haven't been able to find an example of that either.
Sep 26 '12 #1
3 4395
zmbd
5,501 Expert Mod 4TB
You really haven't given us enough detail about the database.

However, let's say you have the following:

table name: tbl_employees
[employee_pk] autonumber primarykey
[employee_fname] text(25)
[employee_lname] text(25)

table name: tbl_meetings
[meetings_pk] autonumber primary key
[meetings_date] date
[FK_employee_assigned] numeric long, 1:M with tbl_employees
[...]

So the basic logic:

In VBA, find the last record in tbl_meetings and fetch the value from [FK_employee_assigned]. You can do this a number of ways. Open a record set and move last is one such, you can use a query to return the max date or the max [meetings_pk] etc...

Take the found value for [FK_employee_assigned] and find the matching record in tbl_employees, determine if that is the last record in the table, if so then start at the top of the table else do a move next and pull the [employee_pk] value for entry into the new record in tbl_meetings [FK_employee_assigned]
Sep 26 '12 #2
TheSmileyCoder
2,322 Expert Mod 2GB
Well there are so many ways to approach this.

One way could be to simply store the last used representative ID in a table, and based on that choose the next in line (Could use a Dao recordset and the FindNext method for instance). You could tie it into the Before_Insert event, or load it as a default value when the form is loaded.

A more refined method would involved checking to see who is available at the desired time, and then choose the one with the least workload, but that is a way more refined solution.
Sep 26 '12 #3
TheSmileyCoder
2,322 Expert Mod 2GB
I see zmbd beat me to this one. He has a very good point though, no need to store the last used representative, since he is allready stored in whatever meeting table you have, and you should off course just pull it out of that table.
Sep 26 '12 #4

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

Similar topics

1
by: Katie M | last post by:
I am working on a license program in Access 2000. Every year, the county assigns a block of numbers to be used. When someone applies for a license, they are assigned from that group. For...
2
by: Deniz Bahar | last post by:
Hi, I'm working with a single linked list and want to delete elements by searching through the list (starting form the HEAD) then finding the element, then doing the following: NewElement =...
1
by: Jason L James | last post by:
Hi All, does anyone have the sequence of commands to add a new task to an outlook task list using the outlook Object Model. I've tried a few things but I can't ssem to get it quite right. ...
23
by: Mitchell Vincent | last post by:
Is there any way to "skip" iterations in a for loop? Example : for x = 1 to 10 if something = 1 next endif
9
by: helpful sql | last post by:
Hi all, I want to write a .Net solution that I would like to run as a scheduled task in windows. I am not going to need any user interface. What I don't understand is what kind of project I need...
11
by: scsTiger | last post by:
I am using Access 2000 as the front end and MS SQL 2000 as the backend. I have a one record form that I set using something like: strSQL = "SELECT * FROM dbo_WBACCT WHERE...
5
by: zgh1970 | last post by:
Hi, We have some tables with db2 generated field. How can I find the next generated sequence fot those fields. Thanks,
1
by: tellercb | last post by:
Hello everyone! I'm new here, so go easy on me ;-) I have a pretty good skillset with VBA for Excel, but now I'm venturing out into Access. So if the solution I'm looking for requires VBA (and I'm...
17
by: angi35 | last post by:
Hi - I'm working in Access 2000. I've got a strange numbering system for work orders, and I'm wondering if, nonetheless, there's a way to get Access to assign the next incremental number for a new...
5
by: trinismooth | last post by:
(Before I post I must say that this Forum has assisted me greatly in solving many if not all of my problems and for that I am very grateful) At present I have a form that has 4 sub...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.