Assigning work to team 1 and team 2

B

bob

Hi

I need to allocate certain work to 2 teams, the only way I can think of
doing this is by building a counter and then giving the even numbers to one
team and the odd numbers to the other.

Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblTeamCounter", dbOpenDynaset)
rs.Edit
rs!RepNum = rs!RepNum + 1
rs.Update
rs.Close: Set rs = Nothing

The above code gives me the counter how do I code it to lookup the REPNum
and if it is even number then

Me.Team1 = True
Else
Me.Team2 = True

Or is there a better way of doing this?

Thanks,

Bob
 
J

Jeff Boyce

Bob

How depends on what ... and you haven't describe what your data structure
looks like.

More info, please.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
B

bob

Jeff

What I am trying to do is lookup the data in table tblTeamCounter field
RepNum from form IncidentData if this is an even number then
Field Team1 on the IncidentDate form has a true value if its an odd number
then Field Team2 has a true value. The rest I can sort out, it is how to
code the lookup the value in the table and how it knows if it is odd or even
I am stuck with.

Hope this helps explains what I am trying to do.

Thanks,

Bob
 
J

Jeff Boyce

Again, you are describing "how".

Consider posting a description of your table structure, something along the
lines of (example only):

tblStudent
StudentID
FName
LName
DOB
...

tblClass
ClassID
ClassTitle
ClassDescription
...

trelEnrollment
EnrollmentID
StudentID
ClassID
EnrollmentDate
...

This is a (very) rough outline of an overly-simplified class enrollment
table structure.

(still) more info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

Jeff Boyce

.... and on the other hand, if you are simply looking for someone to tell you
what button to push, please say so. My particular bent is to try to
understand the need before figuring out the tool.

I'm sure there will be folks willing to oblige.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
B

BruceM via AccessMonster.com

This expression will return true for odd numbers, and false for even:
[RepNum] Mod 2 = 1

I don't begin to understand what you are trying to do, but if your request is
simply for a way to identify odd and even integers, this should do it. VBA
Help has more information about the Mod operator, but essentially it is the
remainder when the first number ([RepNum] is divided by the second number (2).

Jeff

What I am trying to do is lookup the data in table tblTeamCounter field
RepNum from form IncidentData if this is an even number then
Field Team1 on the IncidentDate form has a true value if its an odd number
then Field Team2 has a true value. The rest I can sort out, it is how to
code the lookup the value in the table and how it knows if it is odd or even
I am stuck with.

Hope this helps explains what I am trying to do.

Thanks,

Bob
[quoted text clipped - 35 lines]
 
B

bob

Bruce

That was all I needed, I how have it working.

Thanks,

Bob
BruceM via AccessMonster.com said:
This expression will return true for odd numbers, and false for even:
[RepNum] Mod 2 = 1

I don't begin to understand what you are trying to do, but if your request
is
simply for a way to identify odd and even integers, this should do it.
VBA
Help has more information about the Mod operator, but essentially it is
the
remainder when the first number ([RepNum] is divided by the second number
(2).

Jeff

What I am trying to do is lookup the data in table tblTeamCounter field
RepNum from form IncidentData if this is an even number then
Field Team1 on the IncidentDate form has a true value if its an odd number
then Field Team2 has a true value. The rest I can sort out, it is how to
code the lookup the value in the table and how it knows if it is odd or
even
I am stuck with.

Hope this helps explains what I am trying to do.

Thanks,

Bob
[quoted text clipped - 35 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top