Skip to content

Commit

Permalink
Added Meet Manager Export. Modified DB Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ruddj committed May 4, 2017
1 parent 604e67b commit 26461ae
Show file tree
Hide file tree
Showing 52 changed files with 1,488 additions and 656 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [5.1.0] - 2017-05-04
### Added
- Meet Manager Export.

### Changed
- Database Schema of Carnival files modified to add Meet Manager Mappings.
- New fields added in Miscellaneous: Mteam, Mcode, Mtop.
- New fields added in EventType: Mevent.
- Updated Sample Databases

## [5.0.2] - 2017-04-28
### Added
- Maintain Competitors listbox now supports type-ahead search
Expand Down Expand Up @@ -156,6 +166,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).


[Unreleased]: https://github.com/ruddj/SportsAdmin/compare/v5.0.2...HEAD
[5.1.0]: https://github.com/ruddj/SportsAdmin/compare/v5.0.2...v5.1.0
[5.0.2]: https://github.com/ruddj/SportsAdmin/compare/v5.0.1...v5.0.2
[5.0.1]: https://github.com/ruddj/SportsAdmin/compare/v5.0.0...v5.0.1
[5.0.0]: https://github.com/ruddj/SportsAdmin/tree/v5.0.0
4 changes: 2 additions & 2 deletions Source/forms/Carnival Copy.bas
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Private Function AddCarnival() As Variant
On Error GoTo Err_AddCarnival
Dim MyDb As Database, ITable As Recordset, SpecifiedPath As Variant, TT As TableDef, FTable As Recordset
Dim DataExists As Variant, MyWS As Workspace, CPath As Variant, AskUser As Variant
Dim Result As Variant, ReturnVal As Variant, Db As Database
Dim Result As Variant, ReturnVal As Variant, db As Database
Dim NewDir As String, OldDB As String, NextCarn As String
AskUser = False

Expand All @@ -235,7 +235,7 @@ Private Function AddCarnival() As Variant
If InStr(ReverseString(CStr(Result)), "\") <> 0 Then
Set MyWS = DBEngine.Workspaces(0)
Set MyDb = CurrentDb()
Set Db = MyWS.OpenDatabase(Result)
Set db = MyWS.OpenDatabase(Result)
Set ITable = MyDb.OpenRecordset("SELECT * FROM [Inventory Attached Tables] Where [IF ID] = 2;")
Do Until ITable.EOF
If ITable![Table Name] = "CompetitorsOrdered" Then
Expand Down
42 changes: 21 additions & 21 deletions Source/forms/Carnivals Maintain.bas
Original file line number Diff line number Diff line change
Expand Up @@ -552,15 +552,15 @@ End Sub
Private Sub Form_Load()

On Error GoTo Err_Form_Load
Dim Db As Database, TB As TableDef, FileName As String, RPath As String, RFile As String, FilenamePath As Variant
Dim db As Database, TB As TableDef, FileName As String, RPath As String, RFile As String, FilenamePath As Variant
DoCmd.SetWarnings False

DoCmd.RunSQL "UPDATE DISTINCTROW Carnivals SET Carnivals.Available = FileExists(GetCarnivalFullDir([Relative Directory]) & [Filename]);"
Me.List.Requery
Me.List = Null
Set Db = CurrentDb()
Set db = CurrentDb()
'Db.TableDefs.Refresh
Set TB = Db.TableDefs("Competitors")
Set TB = db.TableDefs("Competitors")
FileName = UCase$(Right$(TB.connect, Len(TB.connect) - InStr(TB.connect, "=")))
FilenamePath = Left$(FileName, Len(FileName) - InStr(ReverseString(FileName), "\") + 1)
''RFile = Right$(Filename, Len(Filename) - Len(RPath))
Expand All @@ -570,7 +570,7 @@ Private Sub Form_Load()
UserQuit = False

Exit_Form_Load:
Set Db = Nothing
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub
Err_Form_Load:
Expand Down Expand Up @@ -620,15 +620,15 @@ On Error GoTo ImportCarnivalList_Click_Err
If ReturnVar = "" Then
' Action Cancelled
Else
Dim Db As Database, adb As Database, Crs As Recordset, ocrs As Recordset
Dim db As Database, adb As Database, Crs As Recordset, ocrs As Recordset
Dim wsp As Workspace, Criteria As String

Set Db = CurrentDb()
Set db = CurrentDb()
Set wsp = DBEngine.Workspaces(0)
' Return reference to Another.mdb.
Set adb = wsp.OpenDatabase(ReturnVar)

Set Crs = Db.OpenRecordset("Carnivals", dbOpenDynaset)
Set Crs = db.OpenRecordset("Carnivals", dbOpenDynaset)
Set ocrs = adb.OpenRecordset("Carnivals")

ocrs.MoveFirst
Expand Down Expand Up @@ -657,7 +657,7 @@ On Error GoTo ImportCarnivalList_Click_Err
End If

ImportCarnivalList_Click_Exit:
Set Db = Nothing
Set db = Nothing
Set adb = Nothing
Exit Sub

Expand Down Expand Up @@ -724,7 +724,7 @@ Private Sub locateCarnival()
On Error GoTo Err_locateCarnival
Dim MyDb As Database, ITable As Recordset, SpecifiedPath As Variant, TT As TableDef, FTable As Recordset
Dim DataExists As Variant, MyWS As Workspace, CPath As Variant, AskUser As Variant
Dim Result As Variant, ReturnVal As Variant, Db As Database
Dim Result As Variant, ReturnVal As Variant, db As Database
Dim NewDir As String, OldDB As String, NextCarn As String

' Stop
Expand All @@ -746,7 +746,7 @@ Private Sub locateCarnival()
If InStr(ReverseString(CStr(Result)), "\") <> 0 Then
Set MyWS = DBEngine.Workspaces(0)
Set MyDb = MyWS.Databases(0)
Set Db = MyWS.OpenDatabase(Result)
Set db = MyWS.OpenDatabase(Result)
Set ITable = MyDb.OpenRecordset("SELECT * FROM [Inventory Attached Tables] Where [IF ID] = 2;")
Do Until ITable.EOF
Set TT = MyDb.TableDefs(ITable![Table Name])
Expand All @@ -763,14 +763,14 @@ Private Sub locateCarnival()
DoCmd.SetWarnings True
AskUser = True

Db.Close
db.Close

End If
End If

Exit_locateCarnival:
Set MyDb = Nothing
Set Db = Nothing
Set db = Nothing

DoCmd.SetWarnings True
Exit Sub
Expand Down Expand Up @@ -811,25 +811,25 @@ Private Sub Rename_Click()

End Sub
Private Sub FinaliseCarnivalSelection()
Dim Db As Database, rs As Recordset
Dim db As Database, Rs As Recordset

' Check that there is at least one record in MiscHTML table
If DCount("[GenerateHTML]", "MiscHTML") = 0 Then

Set Db = DBEngine.Workspaces(0).Databases(0)
Set db = DBEngine.Workspaces(0).Databases(0)
' Update DAO object after chaning DB Structure
Db.TableDefs.Refresh
db.TableDefs.Refresh

Set rs = Db.OpenRecordset("MiscHTML")
rs.AddNew
rs!GenerateHTML = False
rs.Update
rs.Close
Set Rs = db.OpenRecordset("MiscHTML")
Rs.AddNew
Rs!GenerateHTML = False
Rs.Update
Rs.Close
End If
End Sub
Private Sub CompactCarnivalBut_Click()

Dim FileName As Variant, Db As Database, FilePath As Variant, Response As Variant, TempName As Variant
Dim FileName As Variant, db As Database, FilePath As Variant, Response As Variant, TempName As Variant

On Error GoTo Err_CompactCarnivalBut_Click

Expand Down
40 changes: 20 additions & 20 deletions Source/forms/CompEventsSummary.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1142,19 +1142,19 @@ On Error GoTo Err_PromoteBut_Click
DoCmd.SetWarnings True
GlobalCancel = False

Dim Db As Database, rs As Recordset, EventsPromoted As Variant
Dim db As Database, Rs As Recordset, EventsPromoted As Variant

EventsPromoted = False

Set Db = CurrentDb()
Set db = CurrentDb()

Q = "SELECT DISTINCT Events.E_Code, Heats.Status, Heats.F_Lev "
Q = Q & "FROM EventType INNER JOIN (Events INNER JOIN Heats ON Events.E_Code = Heats.E_Code) ON EventType.ET_Code = Events.ET_Code "
Q = Q & "WHERE Heats.Status=2 and Heats.F_Lev <> 0 "

Set rs = Db.OpenRecordset(Q, dbOpenDynaset) ' Create Recordset.
Set Rs = db.OpenRecordset(Q, dbOpenDynaset) ' Create Recordset.

TotalEvents = rs.RecordCount
TotalEvents = Rs.RecordCount

If TotalEvents = 0 Then
MsgBox ("There are no Finals to be promoted.")
Expand All @@ -1164,18 +1164,18 @@ On Error GoTo Err_PromoteBut_Click

ReturnValue = SysCmd(acSysCmdInitMeter, "Promoting Competitors", TotalEvents) ' Display message in status bar.

rs.MoveFirst
Rs.MoveFirst
X = 1

DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE DISTINCTROW ShowDialog SET ShowDialog.ShowDialog = Yes"
DoCmd.SetWarnings True


While Not rs.EOF And Not GlobalCancel
While Not Rs.EOF And Not GlobalCancel
'Stop
If rs!F_Lev <> 0 Then
E_Code = rs!E_Code
If Rs!F_Lev <> 0 Then
E_Code = Rs!E_Code
Ev = DLookup("[ET_Des]", "Events in Full", "[E_Code]=" & E_Code)
Ev = Ev & " Age: " & DLookup("[Age]", "Events in Full", "[E_Code]=" & E_Code)
Ev = Ev & " Sex: " & DLookup("[Sex]", "Events in Full", "[E_Code]=" & E_Code)
Expand All @@ -1193,15 +1193,15 @@ On Error GoTo Err_PromoteBut_Click

If Not GlobalNo And Not GlobalCancel Then

Result = PromoteEventFinal(rs!E_Code)
Result = PromoteEventFinal(Rs!E_Code)
If Result = True Then
EventsPromoted = True
End If
ReturnValue = SysCmd(acSysCmdUpdateMeter, X) ' Update meter.
X = X + 1
End If
End If
rs.MoveNext
Rs.MoveNext

Wend

Expand All @@ -1216,13 +1216,13 @@ On Error GoTo Err_PromoteBut_Click

End If

rs.Close
Rs.Close




Exit_PromoteBut_Click:
Set Db = Nothing
Set db = Nothing
Exit Sub

Err_PromoteBut_Click:
Expand All @@ -1245,25 +1245,25 @@ End Sub

Private Sub PromoteSelectedBut_Click()

Dim Db As Database, rs As Recordset
Set Db = DBEngine.Workspaces(0).Databases(0)
Dim db As Database, Rs As Recordset
Set db = DBEngine.Workspaces(0).Databases(0)

Set rs = Db.OpenRecordset("Heats", dbOpenDynaset) ' Create Recordset.
Set Rs = db.OpenRecordset("Heats", dbOpenDynaset) ' Create Recordset.

If IsNull([Summary]) Then
MsgBox ("You must select an event from the 'Completed' Final list.")
Else
Criteria = "[HE_Code]= " & [Summary]
rs.FindFirst Criteria
Rs.FindFirst Criteria

If rs.NoMatch Or rs!Status <> 2 Then
If Rs.NoMatch Or Rs!Status <> 2 Then
MsgBox ("You must select an event from the 'Completed' Final list.")
ElseIf rs!F_Lev = 0 Then
ElseIf Rs!F_Lev = 0 Then
MsgBox ("The event you are trying to promote is at the highest final level. There is no final for competitors to be promoted into.")

Else
E_Code = rs!E_Code
F_Lev = rs!F_Lev
E_Code = Rs!E_Code
F_Lev = Rs!F_Lev
E_Des = EventDescription(E_Code)
E_Sex = EventSex(E_Code)
E_Age = EventAge(E_Code)
Expand Down
8 changes: 4 additions & 4 deletions Source/forms/CompetitorsSummary.bas
Original file line number Diff line number Diff line change
Expand Up @@ -449,25 +449,25 @@ Private Sub CreateTeamNames_Click()
PleaseWaitMsg = "Adding Team Competitor Names ..."
DoCmd.RunMacro "ShowPleaseWait"

Dim Criteria As String, Db As Database, Hrs As Recordset, Ars As Recordset
Dim Criteria As String, db As Database, Hrs As Recordset, Ars As Recordset
Dim NewTitle As String

Call UpdateEventCompetitorAge

Set Db = DBEngine.Workspaces(0).Databases(0)
Set db = DBEngine.Workspaces(0).Databases(0)

Q = " SELECT DISTINCTROW House.H_Code, House.CompPool, House.Include, House.H_ID FROM House "
Q = Q & "GROUP BY House.H_Code, House.CompPool, House.Include, House.H_ID "
Q = Q & "HAVING House.Include=Yes"

Set Hrs = Db.OpenRecordset(Q, dbOpenDynaset) ' Create dynaset.
Set Hrs = db.OpenRecordset(Q, dbOpenDynaset) ' Create dynaset.


Q = "SELECT DISTINCT CompetitorEventAge.Eage, Str(Val([Eage])) AS Age "
Q = Q & "FROM CompetitorEventAge "
Q = Q & "GROUP BY CompetitorEventAge.Eage, Str(Val([Eage]))"

Set Ars = Db.OpenRecordset(Q, dbOpenDynaset) ' Create dynaset.
Set Ars = db.OpenRecordset(Q, dbOpenDynaset) ' Create dynaset.

If Hrs.BOF Then
' No Teams so do nothing
Expand Down
10 changes: 5 additions & 5 deletions Source/forms/CopyCompetitorsBetweenEvents.bas
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ End Sub
Private Sub CopyCompetitors_Click()
On Error GoTo Err_CopyCompetitors_Click

Dim Db As Database, Frs As Recordset, Trs As Recordset, Retval As Variant
Dim db As Database, Frs As Recordset, Trs As Recordset, Retval As Variant
Dim FailedI As Integer, msg As Variant, success As Variant

If MsgBox("Are you sure you want to copy competitors from one event to another?", vbYesNo + vbDefaultButton2 + vbQuestion) = vbNo Then Exit Sub
Expand All @@ -429,9 +429,9 @@ On Error GoTo Err_CopyCompetitors_Click
' New entry in CompEvents table
' All fields remain the same except for E_Code (generate by looking up in "Events in Full" query

Set Db = CurrentDb()
Set Frs = Db.OpenRecordset("CompEvents-With Event Type", dbOpenDynaset) ' Create Recordset.
Set Trs = Db.OpenRecordset("CompEvents", dbOpenDynaset) ' Create Recordset.
Set db = CurrentDb()
Set Frs = db.OpenRecordset("CompEvents-With Event Type", dbOpenDynaset) ' Create Recordset.
Set Trs = db.OpenRecordset("CompEvents", dbOpenDynaset) ' Create Recordset.

'Stop

Expand Down Expand Up @@ -509,7 +509,7 @@ On Error GoTo Err_CopyCompetitors_Click

Exit_CopyCompetitors_Click:
DoCmd.RunMacro "ClosePleaseWait"
Set Db = Nothing
Set db = Nothing
Exit Sub

Err_CopyCompetitors_Click:
Expand Down
Loading

0 comments on commit 26461ae

Please sign in to comment.