Show Bid Request
Team Roster Creator - Final Touches to Existing Code
Bid Request Id: 5454
|
Bookmark
|
Posted by: |
ski2sun (2 ratings)
(Software buyer rating 9)
|
Posted: |
11/25/2001 8:51:18 PM EST
|
Bidding Closes: |
12/2/2001 8:53:49 PM EST
|
Viewed: |
131 times
|
|
|
|
Description:
This project has an initial code which is intended to create soccer teams based: 1. on days players are available for practice, 2. gender/league participant is in, 3. skill rating (1,2,3), 4. and school (SEE DBO_PLAYERS TABLE). I believe a programmer could rectify my problem in a minute once the module and table is reviewed. I simply want an Access form & print report feature that would allow me to select all the players in a particular league type (ex: FIU09, would mean females, in intramural, U-9 group. All parents inform us of the nights their children cannot play (negative database), then looks at rating, and school, to make sure there is a BALANCED team consisting of not too many players of one rating, and not too many players from one school. The school criteria segment is not in the code attached and below. I need help with this quickly, and asap. Your help would be GREATLY APPRECIATED. See Code needing help and revision below in deliverable:
Deliverables: Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased. Yes to above, understanding that code is already original from buyer of services. Requesting final revisions which become sole property of buyer once acceptable final form and league type print roster report capability utilizing ALL beforementioned player-team criterias.
Option Compare Database
Option Explicit
Sub LeagueTeamSelector()
Dim intDone As Integer
Dim intTotPlayers As Integer
Dim strLeague As String
Dim intPlayerId As Integer
Dim strSQL As String
Dim blnWeekDone As Boolean
Dim strRatingM As String
Dim strRatingT As String
Dim strRatingW As String
Dim strRatingTH As String
Dim strRatingF As String=
Dim cnn As ADODB.Connection
Set cnn = CurrentProject.Connection
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim cmd As ADODB.Command
strLeague = InputBox("Enter League to Process")
strSQL = "SELECT Count(dbo_Players.PlayerID) AS TotPlayers " & _
"FROM dbo_Players " & _
"WHERE dbo_Players.League = '" & strLeague & "';"
rs.Open strSQL, cnn, , , adCmdText
intTotPlayers = rs("TotPlayers")
rs.Close
intDone = 0
blnWeekDone = False
strRatingM = "1"
strRatingT = "1"
strRatingW = "1"
strRatingTH = "1"
strRatingF = "1"
Do Until blnWeekDone
'Get a Monday player
If strRatingM < 4 Then
strSQL = "SELECT min(PlayerID) as Player " & _
"FROM dbo_Players " & _
"Where ((League = '" & strLeague & "') " & _
"AND (NOT Selected) " & _
"AND (M)) " & _
"AND Rating = '" & strRatingM & "'; "
rs.Open strSQL, cnn, , , adCmdText
If rs("Player") <> "Null" Then
intPlayerId = rs("Player")
strSQL = "UPDATE dbo_Players " & _
"SET dbo_Players.Selected = Yes, " & _
"dbo_Players.TeamDay = 'M' " & _
"WHERE (((dbo_Players.PlayerID)=" & rs("Player") & ")) ;"
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandText = strSQL
cmd.Execute
Else
strRatingM = strRatingM + 1
End If
rs.Close
End If 'All Monday Records done
'Get a Tuesday player
If strRatingT < 4 Then
strSQL = "SELECT min(PlayerID) as Player " & _
"FROM dbo_Players " & _
"Where ((League = '" & strLeague & "') " & _
"AND (NOT Selected) " & _
"AND (T)) " & _
"AND Rating = '" & strRatingT & "'; "
rs.Open strSQL, cnn, , , adCmdText
If rs("Player") <> "Null" Then
intPlayerId = rs("Player")
strSQL = "UPDATE dbo_Players " & _
"SET dbo_Players.Selected = Yes, " & _
"dbo_Players.TeamDay = 'T' " & _
"WHERE (((dbo_Players.PlayerID)=" & rs("Player") & ")) ;"
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandText = strSQL
cmd.Execute
Else
strRatingT = strRatingT + 1
End If
rs.Close
End If 'All Tuesday Records done
'Get a Wednesday player
If strRatingW < 4 Then
strSQL = "SELECT min(PlayerID) as Player " & _
"FROM dbo_Players " & _
"Where ((League = '" & strLeague & "') " & _
"AND (NOT Selected) " & _
"AND (W)) " & _
"AND Rating = '" & strRatingW & "'; "
rs.Open strSQL, cnn, , , adCmdText
If rs("Player") <> "Null" Then
intPlayerId = rs("Player")
strSQL = "UPDATE dbo_Players " & _
"SET dbo_Players.Selected = Yes, " & _
"dbo_Players.TeamDay = 'W' " & _
"WHERE (((dbo_Players.PlayerID)=" & rs("Player") & ")) ;"
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandText = strSQL
cmd.Execute
Else
strRatingW = strRatingW + 1
End If
rs.Close
End If 'All Wednesday Records done
'Get a Thursday player
If strRatingTH < 4 Then
strSQL = "SELECT min(PlayerID) as Player " & _
"FROM dbo_Players " & _
"Where ((League = '" & strLeague & "') " & _
"AND (NOT Selected) " & _
"AND (TH)) " & _
"AND Rating = '" & strRatingTH & "'; "
rs.Open strSQL, cnn, , , adCmdText
If rs("Player") <> "Null" Then
intPlayerId = rs("Player")
strSQL = "UPDATE dbo_Players " & _
"SET dbo_Players.Selected = Yes, " & _
"dbo_Players.TeamDay = 'TH' " & _
"WHERE (((dbo_Players.PlayerID)=" & rs("Player") & ")) ;"
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandText = strSQL
cmd.Execute
Else
strRatingTH = strRatingTH + 1
End If
rs.Close
End If 'All Thursday Records done
'Get a Friday player
If strRatingF < 4 Then
strSQL = "SELECT min(PlayerID) as Player " & _
"FROM dbo_Players " & _
"Where ((League = '" & strLeague & "') " & _
"AND (NOT Selected) " & _
"AND (F)) " & _
"AND Rating = '" & strRatingF & "'; "
rs.Open strSQL, cnn, , , adCmdText
If rs("Player") <> "Null" Then
intPlayerId = rs("Player")
strSQL = "UPDATE dbo_Players " & _
"SET dbo_Players.Selected = Yes, " & _
"dbo_Players.TeamDay = 'F' " & _
"WHERE (((dbo_Players.PlayerID)=" & rs("Player") & ")) ;"
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandText = strSQL
cmd.Execute
Else
strRatingF = strRatingF + 1
End If
rs.Close
End If 'All Friday Records done
'Check to see if we have processed all the records from all the days.
'Each rating will be = 4 if we have.
If strRatingM + strRatingT + strRatingW + strRatingTH + strRatingF = "44444" Then
blnWeekDone = True
End If
Loop
End Sub
Special Conditions / Other:
I would like the code below to be done asap for registration season Sooner better than later, so i can test, and verify its workings...
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation, you can report it to: abuse@rentacoder.com.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
This bid was accepted by the buyer!
|
$25
|
11/26/2001 1:17:54 AM EST
|
9
(Superb)
|
|
|
Hi,
As I'm sure you are aware, the
method of choosing players used
in the code is pretty straight
forward. That is, there may be
more 'sophisticated' ways of doing
this, and for choosing the school.
Do you or the buyer have any preferences
on this?
I don't see the table you mentioned
in the bid request. I assume this
is an oversite, and it will be provided?
I've taken the code you posted
and formatted it into an Access
database form.
I modularized the code into 4 separate procedures.
The overall original algorithm is the same as you posted -
I've simply broken it into smaller
pieces so that it is easier to understand
(hopefully), less code duplication, and
easier to reuse parts of the code in
different contexts - for instance,
you could now schedule one player
day, or one player level at a time
(or some combination) or all at
once as is the case with calling
the main sub procedure as in the
original code.
Adding the required addtional
functionality, and more if needed,
should be a snap.
Please see my profile for resume,
and buyer comments. In my as
yet short affiliation with this
site, all of my customers are very
satisfied. I have web and ftp
sites, email, and instant messenger
which I use to help make the
development process very smooth,
trouble free.
Sincerely,
Bryan Hoover
|
|
|
|
|
|