THEO TODMAN’S WEBSITE CODE PAGES



This Page provides a jumping-off point for the VBA Code that generates my Website.

Table of Code Documentation Location 31 (11 items)

Form_OpenCount_BookPapersFunctor_19Functor_21
Functor_22Functor_23Number_FormatAeon_Authors_Add
BooksToNotes_PrelimsCheckerJacks_Non_Prime.

To access information, click on one of the links in the table above.

Go to top of page




Source Code of: Aeon_Authors_Add
Procedure Type: Public Sub
Module: New Code
Lines of Code: 108
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Sub Aeon_Authors_Add()
0002Dim rs As Recordset
0003Dim rsAuthors As Recordset
0004Dim rsAuthor_Parameter As Recordset
0005Dim strQuery As String
0006Dim strAuthor As String
0007Dim strAuthor_Saved As String
0008Dim Author As String
0009Dim Author_Reformat As String
0010Dim i As Integer
0011Dim j As Integer
0012Dim k As Integer
0013Dim x As Integer
0014Dim strMessage As String
0015Dim Output_Authors As Boolean
0016Dim Output_Old_Authors As Boolean
0017 strMessage = "Get ready to output Authors pages? Usually wait to output until we've output the Aeon note with 'Refresh Links', but this will maintain the Author_Parameter table."
0018If MsgBox(strMessage, vbYesNo + vbDefaultButton1) = vbYes Then
0019 Output_Authors = True
0020 strMessage = "Add all relevant Authors pages, including newly-loaded ones, to Author_Parameter table?"
0021 If MsgBox(strMessage, vbYesNo + vbDefaultButton1) = vbYes Then
0022 Output_Old_Authors = True
0023 Else
0024 Output_Old_Authors = False
0025 End If
0026Else
0027 Output_Authors = False
0028 Output_Old_Authors = False
0029End If
0030strAuthor_Saved = ""
0031' Clear & ready Author_Parameter Table
0032 strQuery = "DELETE * FROM Author_Parameter;"
0033DoCmd.RunSQL (strQuery)
0034 strQuery = "SELECT * FROM Author_Parameter;"
0035Set rsAuthor_Parameter = CurrentDb.OpenRecordset(strQuery)
0036' Select Aeon_Files rows with Authors encoded
0037 strQuery = "SELECT Aeon_Files.Author_Names FROM Aeon_Files WHERE (((Aeon_Files.Author_Names) Like ""*+A*"")) ORDER BY Aeon_Files.Author_Names;"
0038Set rs = CurrentDb.OpenRecordset(strQuery)
0039rs.MoveFirst
0040Do Until rs.EOF
0041 strAuthor = rs.Fields(0)
0042 If strAuthor <> strAuthor_Saved Then
0043 'Find the authors
0044 i = 1
0045 j = 1
0046 Do Until j = 0
0047 j = InStr(i, strAuthor, "A+")
0048 If j > 0 Then
0049 Author = Mid(strAuthor, i + 2, j - i - 2)
0050 'Check if on Author's Table
0051 strQuery = "SELECT Authors.Author_Name, Authors.Author_Name_Display FROM Authors WHERE (((Authors.Author_Name)=""" & Author & """));"
0052 Set rsAuthors = CurrentDb.OpenRecordset(strQuery)
0053 If rsAuthors.EOF Then
0054 Debug.Print Author
0055 Author_Reformat = Author
0056 x = InStr(Author_Reformat, "(")
0057 If x > 0 Then
0058 k = InStr(x, Author_Reformat, ")")
0059 If k > 0 Then
0060 Author_Reformat = Mid(Author_Reformat, x + 1, k - x - 1) & " " & Trim(Left(Author_Reformat, x - 1))
0061 End If
0062 End If
0063 'Load to Author's table
0064 rsAuthors.AddNew
0065 rsAuthors.Fields(0) = Author
0066 rsAuthors.Fields(1) = Author_Reformat
0067 rsAuthors.Update
0068 Set rsAuthors = Nothing
0069 'Add to Author_Parameter Table, ready for output of the Author pages
0070 rsAuthor_Parameter.AddNew
0071 rsAuthor_Parameter.Fields(0) = Author
0072 rsAuthor_Parameter.Update
0073 Else
0074 If Output_Old_Authors = True Then
0075 'Add to Author_Parameter Table, ready for output of the Author pages (existing authors need to have their pages updated)
0076 rsAuthor_Parameter.AddNew
0077 rsAuthor_Parameter.Fields(0) = Author
0078 On Error Resume Next
0079 rsAuthor_Parameter.Update
0080 End If
0081 End If
0082 i = j
0083 i = InStr(i, strAuthor, "+A")
0084 If i = 0 Then
0085 j = 0
0086 End If
0087 End If
0088 Loop
0089 End If
0090 strAuthor_Saved = strAuthor
0091 rs.MoveNext
0092Loop
0093If Output_Authors = True Then
0094 strMessage = "Actually output the Authors pages? Usually wait until we've output the Aeon note with 'Refresh Links'."
0095 If MsgBox(strMessage, vbYesNo + vbDefaultButton2) = vbYes Then
0096 'Output the Author pages
0097 strDataQuery = "Authors_List_Selected_Authors"
0098 strControlTable = "Authors"
0099 strOutputFileShort = "Author"
0100 strOutputFolder = "C:\Theo's Files\Websites\Theo's Website\Authors\"
0101 strOutputFile = ""
0102 CreateAuthorsWebPages ("Regen")
0103 End If
0104End If
0105OK = MsgBox("Authors added OK at " & Now(), vbOKOnly)
0106Set rs = Nothing
0107Set rsAuthor_Parameter = Nothing
0108End Sub

Procedures Calling This Procedure (Aeon_Authors_Add) Procedures Called By This Procedure (Aeon_Authors_Add) Tables / Queries / Fragments Directly Used By This Procedure (Aeon_Authors_Add) Go To Start of This Procedure
Go To Top of This Page
Link to VBA Code Control Page



Source Code of: BooksToNotes_Prelims
Procedure Type: Public Sub
Module: Testing
Lines of Code: 10

Line-No. / Ref.Code Line
0001Public Sub BooksToNotes_Prelims()
0002Dim strQuery As String
0003 strQuery = "DELETE * FROM Cross_Reference_Prelims;"
0004DoCmd.RunSQL (strQuery)
0005 strQuery = "BooksToNotes_Prelims_GEN"
0006DoCmd.OpenQuery (strQuery)
0007'Delete rows associated with Note 874 (Auto-Xref Test Note)
0008 strQuery = "DELETE * FROM Cross_Reference_Prelims WHERE Calling_ID = 874 AND Calling_Type = ""N"";"
0009DoCmd.RunSQL (strQuery)
0010End Sub

Procedures Calling This Procedure (BooksToNotes_Prelims) Tables / Queries / Fragments Directly Used By This Procedure (BooksToNotes_Prelims) Go To Top of This Page
Link to VBA Code Control Page



Source Code of: Checker
Procedure Type: Public Sub
Module: Testing
Lines of Code: 16

Line-No. / Ref.Code Line
0001Public Sub Checker()
0002Dim rs As Recordset
0003Dim i As Integer
0004Dim ifields As Integer
0005'Set rs = CurrentDb.OpenRecordset("TRANSFORM Sum([Year_Crosstab].[Hours ]) AS Hours SELECT Average_Plans.Project, Average_Plans.[Average This Qtr Plan] AS [Planned Weekly Hours], 0 AS [Planned QTD %age], Sum(0) AS [QTD Actual %], Round([Average YTD Plan],2) AS [Planned YTD %age], Sum(0) AS [YTD Actual %], Sum(0) AS [QTD Actual Hours], Sum(Year_Crosstab.Hours) AS [YTD Actual Hours] FROM Average_Plans LEFT JOIN Year_Crosstab ON Average_Plans.Project = Year_Crosstab.Group WHERE ((((Year_Crosstab.Period) >= ""2019-10"" And (Year_Crosstab.Period) <= ""2020-09"") Or (Year_Crosstab.Period) Is Null)) GROUP BY Average_Plans.Project, Average_Plans.[Average This Qtr Plan], Round([Average YTD Plan],2) ORDER BY Average_Plans.Project PIVOT Year_Crosstab.Period;")
0006 Set rs = CurrentDb.OpenRecordset("SELECT * FROM Project_Plans;")
0007rs.MoveFirst
0008ifields = rs.Fields.Count
0009Do Until rs.EOF
0010 For i = 0 To ifields - 1
0011 Debug.Print rs.Fields(i)
0012 Stop
0013 Next i
0014 rs.MoveNext
0015Loop
0016End Sub

Tables / Queries / Fragments Directly Used By This Procedure (Checker) Go To Top of This Page
Link to VBA Code Control Page



Source Code of: Count_BookPapers
Procedure Type: Public Function
Module: New Code
Lines of Code: 13

Line-No. / Ref.Code Line
0001Public Function Count_BookPapers(strDataQuery_Saved, Author, Medium)
0002Dim rs As Recordset
0003Dim strQuery As String
0004strQuery = "SELECT Count(" & strDataQuery_Saved & ".Title) AS CountOfTitle FROM " & strDataQuery_Saved & " GROUP BY " & strDataQuery_Saved & ".Author_Name, " & strDataQuery_Saved & ".Medium HAVING (((" & strDataQuery_Saved & ".Author_Name)=""" & Author & """) AND ((" & strDataQuery_Saved & ".Medium)=""" & Medium & """));"
0005Set rs = CurrentDb.OpenRecordset(strQuery)
0006If rs.EOF Then
0007 Count_BookPapers = 0
0008Else
0009 rs.MoveLast
0010 Count_BookPapers = rs.Fields(0)
0011End If
0012Set rs = Nothing
0013End Function

Go To Top of This Page
Link to VBA Code Control Page



Source Code of: Form_Open
Procedure Type: Private Sub
Module: Form_MainForm
Lines of Code: 13

Line-No. / Ref.Code Line
0001Private Sub Form_Open(Cancel As Integer)
0002Dim rsTableToRead As Recordset
0003 OK = Check_Database_Size()
0004Debug.Print Now() & " - Main Database size = " & Check_Database_Size & "Mb"
0005 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Archive_Reading_Lists, Archive_Printable_Versions, Document_Tables_Full, Document_Queries_Full FROM System_Parameters;")
0006rsTableToRead.MoveFirst
0007Archive_Reading_Lists = rsTableToRead.Fields(0).Value
0008Archive_Printable_Versions = rsTableToRead.Fields(1).Value
0009Document_Tables_Full = rsTableToRead.Fields(2).Value
0010Document_Queries_Full = rsTableToRead.Fields(3).Value
0011Full_Regen = False
0012Set rsTableToRead = Nothing
0013End Sub

Procedures Called By This Procedure (Form_Open) Tables / Queries / Fragments Directly Used By This Procedure (Form_Open) Go To Top of This Page
Link to VBA Code Control Page



Source Code of: Functor_19
Procedure Type: Public Function
Module: Functors
Lines of Code: 42
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Function Functor_19(Note_ID, Note_Title, Note_Text)
0002'Add jump table and record counts for Aeon Note 1292
0003Dim rs As Recordset
0004Dim strQuery As String
0005Dim Papers_Read As String
0006Dim Papers_UnReadTotal As String
0007Dim Papers_UnRead(10) As Integer
0008Dim Note_Text_Local As String
0009Dim i As Integer
0010Note_Text_Local = Note_Text
0011 strQuery = "SELECT Aeon_Files.[Read?], Count(Aeon_Files.WebRef_ID) AS CountOfWebRef_ID FROM Aeon_Files WHERE (((Aeon_Files.Aeon_Note_ID) = 1292) And ((Aeon_Files.[Exclude?]) = False)) GROUP BY Aeon_Files.[Read?];"
0012Set rs = CurrentDb.OpenRecordset(strQuery)
0013If Not rs.EOF Then
0014 rs.MoveFirst
0015 Papers_Read = rs.Fields(1)
0016 OK = Number_Format(Papers_Read)
0017 rs.MoveLast
0018 Papers_UnReadTotal = rs.Fields(1)
0019 OK = Number_Format(Papers_UnReadTotal)
0020End If
0021 strQuery = "SELECT Aeon_Files.Priority, Count(Aeon_Files.WebRef_ID) AS CountOfWebRef_ID FROM Aeon_Files WHERE (((Aeon_Files.Aeon_Note_ID) = 1292) And ((Aeon_Files.[Read?]) = False) AND ((Aeon_Files.[Exclude?])=False)) GROUP BY Aeon_Files.Priority ORDER BY Aeon_Files.Priority;"
0022Set rs = CurrentDb.OpenRecordset(strQuery)
0023If Not rs.EOF Then
0024 rs.MoveFirst
0025 Do Until rs.EOF
0026 Papers_UnRead(rs.Fields(0)) = rs.Fields(1)
0027 rs.MoveNext
0028 Loop
0029End If
0030Note_Text_Local = "<br><CENTER><TABLE class = ""ReadingList"" WIDTH=1200><TR>"
0031Note_Text_Local = Note_Text_Local & "<TD class = ""BridgeLeft""> <a href=""#Off-Page_Link_Project_Note_1292_Intro""><B>Introduction</a></B></TD>"
0032Note_Text_Local = Note_Text_Local & "<TD class = ""BridgeLeft""> <a href=""#Off-Page_Link_Project_Note_1292_Read""><B>Papers Read</a>: </B>" & Papers_Read & "</TD>"
0033Note_Text_Local = Note_Text_Local & "<TD class = ""BridgeLeft""> <B>Papers Unread: " & Papers_UnReadTotal & "</B> &rarr; </TD>"
0034For i = 0 To 10
0035 If Papers_UnRead(i) > 0 Then
0036 Note_Text_Local = Note_Text_Local & "<TD class = ""BridgeLeft""> <a href=""#Off-Page_Link_Project_Note_1292_Pri_" & i & """><B>Pri " & i & "</B></a>: " & Papers_UnRead(i) & "</TD>"
0037 End If
0038Next i
0039Note_Text_Local = Note_Text_Local & "</TR></TABLE></CENTER><a name=""Off-Page_Link_Project_Note_1292_Intro""></a>"
0040Note_Text = Note_Text_Local
0041Functor_19 = "Yes"
0042End Function

Procedures Calling This Procedure (Functor_19) Procedures Called By This Procedure (Functor_19) Tables / Queries / Fragments Directly Used By This Procedure (Functor_19) Go To Start of This Procedure
Go To Top of This Page
Link to VBA Code Control Page



Source Code of: Functor_21
Procedure Type: Public Function
Module: Functors
Lines of Code: 545
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Function Functor_21(strParameter, strTable, Optional strParameter2)
0002'This function formats a web-table from a Cross-tab query
0003Dim rs As Recordset
0004Dim rs_Temp As Recordset
0005Dim i As Integer
0006Dim j As Long
0007Dim m As Integer
0008Dim n As Integer
0009Dim k(100)
0010Dim iRows As Integer
0011Dim iCols As Integer
0012Dim strTable_Local As String
0013Dim strElement As String
0014Dim strCell As String
0015Dim strCell_1_Saved As String
0016Dim strCell_4_Saved As String
0017Dim strQuery As String
0018Dim strHeader As String
0019Dim iTotal_Col As Integer
0020Dim strParameter2_Local As String
0021Dim Col_Width As Single
0022Dim strWork As String
0023Dim strWork2 As String
0024If IsMissing(strParameter2) Then
0025 strParameter2_Local = ""
0026Else
0027 strParameter2_Local = strParameter2
0028End If
0029Select Case strParameter
0030 Case 1
0031 strQuery = "Cross_Reference_By_Type"
0032 iTotal_Col = 0
0033 Case 2
0034 strQuery = "Cross_Reference_Changes_By_Type"
0035 iTotal_Col = 0
0036 Case 3
0037 strQuery = "Oboe_Practice_Hours_List"
0038 iTotal_Col = 0
0039 Case 4
0040 strQuery = "Auto_Ref_Notes_Stats_Summary"
0041 iTotal_Col = 4
0042 Case 5
0043 iTotal_Col = 5
0044 strQuery = "Auto_Ref_Notes_Stats_Detailed"
0045 Case 6
0046 iTotal_Col = 6 'Dummy
0047 strQuery = "Functor_Calls"
0048 Case 7
0049 Find_Functors
0050 iTotal_Col = 6 'Dummy
0051 strQuery = "Functors_FbyN"
0052 Case 8
0053 Find_Functors
0054 iTotal_Col = 6 'Dummy
0055 strQuery = "Functors_NbyF"
0056 Case 9
0057 strQuery = "Auto_Ref_Notes_Stats_Grand_Summary"
0058 iTotal_Col = 5
0059 Case 10
0060 strQuery = "Auto_Ref_Notes_Stats_Grandest_Summary"
0061 iTotal_Col = 4
0062 Case 11
0063 'Ready some stats!
0064 strQuery = "DELETE * FROM Temp_Lang_Date_Last_Study;"
0065 DoCmd.RunSQL (strQuery)
0066 strQuery = "Temp_Lang_Date_Last_Study_GEN"
0067 DoCmd.OpenQuery (strQuery)
0068 strQuery = "Language_Location_Primer_Time_Zap"
0069 DoCmd.OpenQuery (strQuery)
0070 strQuery = "Language_Location_Primer_Date_Time_Updt"
0071 DoCmd.OpenQuery (strQuery)
0072 strQuery = "Language_Animadversions_List"
0073 iTotal_Col = 6
0074 Case 12
0075 strQuery = "Language_Animadversions_XTab"
0076 iTotal_Col = 50
0077 Case 13
0078 strQuery = "Language_Animadversions_XTab_Pri2"
0079 iTotal_Col = 50
0080 Case 14
0081 strQuery = "PID_Notes_Used_By_Thesis_Chapter_Xtab"
0082 iTotal_Col = 12
0083 Case 15
0084 strQuery = "IdentityPapersRead_Unreferenced"
0085 DoCmd.OpenQuery ("IdentityPapersRead_Unreferenced_Gen")
0086 iTotal_Col = 50
0087 Case 16
0088 strQuery = "PID_Notes_Used_By_Thesis_Chapter_List_Xtab"
0089 iTotal_Col = 12
0090 Case 17
0091 strQuery = "Works_Missing_By_Thesis_Chapter"
0092 iTotal_Col = 20
0093 Case 18
0094 strQuery = "IdentityBooks_Unreferenced"
0095 DoCmd.OpenQuery ("IdentityBooks_Unreferenced_Gen")
0096 iTotal_Col = 50
0097 Case 19
0098 strQuery = "PID_Notes_RL_Category_Xtab"
0099 Case 20
0100 Select Case strParameter2_Local
0101 Case 1
0102 strQuery = "Ling_Database_Summary_XTab_Vocabulary_Latin"
0103 Case 2
0104 strQuery = "Ling_Database_Summary_XTab_Vocabulary_NonLatin"
0105 Case 3
0106 strQuery = "Ling_Database_Summary_XTab_Dialogue_Latin"
0107 Case 4
0108 strQuery = "Ling_Database_Summary_XTab_Dialogue_NonLatin"
0109 End Select
0110 iTotal_Col = 50
0111 Case 21
0112 Select Case strParameter2_Local
0113 Case 1
0114 strQuery = "Ling_Language_Vocab_List_All"
0115 Case 2
0116 strQuery = "Ling_Language_Vocab_Phrase_List_All"
0117 Case 3
0118 strQuery = "Ling_Language_Dialogue_List_All"
0119 Case 4
0120 strQuery = "Ling_Language_Vocab_List_All_LessonSeq"
0121 Case 5
0122 strQuery = "Ling_Language_Vocab_Phrase_List_All_LessonSeq"
0123 Case 6
0124 strQuery = "Ling_Language_Vocab_List_All_ru_uk"
0125 Case 7
0126 strQuery = "Ling_Language_Vocab_List_All_LessonSeq_ru_uk"
0127 Case 8
0128 strQuery = "Ling_Language_Vocab_Phrase_List_All_LessonSeq_ru_uk"
0129 Case 9
0130 strQuery = "Ling_Language_Vocab_Phrase_List_All_ru_uk"
0131 Case 10
0132 strQuery = "Ling_Language_Dialogue_List_All_ru_uk"
0133 End Select
0134 iTotal_Col = 50
0135 Case 22
0136 Select Case strParameter2_Local
0137 Case 1
0138 strQuery = "Ling_Language_Vocab_List_Latin"
0139 Case 2
0140 strQuery = "Ling_Language_Vocab_List_NonLatin"
0141 Case 3
0142 strQuery = "Ling_Language_Dialogue_List_Latin"
0143 Case 4
0144 strQuery = "Ling_Language_Dialogue_List_NonLatin"
0145 End Select
0146 iTotal_Col = 50
0147 Case 23
0148 strQuery = "DELETE * FROM Books_To_Regen;"
0149 DoCmd.RunSQL (strQuery)
0150 DoCmd.OpenQuery ("PID_Books_To_Regen")
0151 strQuery = "PID_Papers_Filed_Not_Referenced"
0152 iTotal_Col = 50
0153 Case 24
0154 strQuery = "PID_Papers_Referenced_Undated"
0155 iTotal_Col = 50
0156 Case 25
0157 strQuery = "PID_Papers_Referenced_No_Abstract"
0158 iTotal_Col = 50
0159 Case 26
0160 strQuery = "Large_Page_List"
0161 iTotal_Col = 50
0162 Case 27
0163 strQuery = "PDF_Missing_List"
0164 iTotal_Col = 50
0165 Case 28
0166 strQuery = "Duplicate_Papers"
0167 iTotal_Col = 50
0168 Case 29
0169 strQuery = "Missing_Webref_DisplayText_List"
0170 iTotal_Col = 50
0171 Case 30
0172 strQuery = "PID_Missing_Online_Papers_List"
0173 iTotal_Col = 50
0174 Case 31
0175 strQuery = "Bible_Reading_Progress"
0176 iTotal_Col = 50
0177 Case 32
0178 strQuery = "Missing_Webref_DisplayText_List_Books"
0179 iTotal_Col = 50
0180 Case 33
0181 strQuery = "PID_Missing_Online_Papers_List_Summary"
0182 iTotal_Col = 5
0183 Case 34
0184 strQuery = "Papers_Inconsistently_Electronic"
0185 iTotal_Col = 50
0186 Case 35
0187 strQuery = "Website_Regen_Control_List"
0188 iTotal_Col = 50
0189 Case 36
0190 strQuery = "BookPaperControl_List"
0191 iTotal_Col = 50
0192 Case 37
0193 strQuery = "Language_Animadversions_XTab_Pri3"
0194 iTotal_Col = 50
0195 Case 38
0196 strQuery = "Language_Animadversions_XTab_Pri4"
0197 iTotal_Col = 50
0198 Case Else
0199 Exit Function
0200End Select
0201strTable_Local = ""
0202j = 0
0203For i = 1 To 100
0204 k(i) = 0
0205Next i
0206Set rs = CurrentDb.OpenRecordset(strQuery)
0207If rs.EOF Then
0208 Debug.Print Now(); "- Functor_21, Option " & strParameter & " - Query: """ & strQuery; """ : No table to print."
0209 Functor_21 = "Yes"
0210 strTable = "|##||.|No items to display.|##|"
0211 Exit Function
0212Else
0213 rs.MoveLast
0214 iRows = rs.RecordCount
0215 iCols = rs.Fields.Count
0216 If iTotal_Col = 0 Then
0217 iTotal_Col = iCols
0218 End If
0219 rs.MoveFirst
0220End If
0221'Set up Table Header
0222Select Case strParameter
0223 Case 3, 15, 17, 18, 23, 24, 25, 28, 29, 30, 32
0224 strElement = "<table width=1500 class = ""ReadingList"">"
0225 Case 7, 8, 26, 27, 34
0226 strElement = "<table width=1000 class = ""ReadingList"">"
0227 Case 11, 22, 31
0228 strElement = "<table width=1200 class = ""ReadingList"">"
0229 Case 12, 13, 20, 37, 38
0230 strElement = "<table width=1200 class = ""Bridge"">"
0231 Case 21
0232 strElement = "<table width=1600 class = ""Bridge"">"
0233 If strParameter2_Local > 5 Then
0234 strElement = "<table width=600 class = ""Bridge"">"
0235 End If
0236 If strParameter2_Local > 7 Then
0237 strElement = "<table width=1200 class = ""Bridge"">"
0238 End If
0239 If strParameter2_Local = 10 Then
0240 strElement = "<table width=900 class = ""Bridge"">"
0241 End If
0242 Case Else
0243 strElement = "<table width=900 class = ""Bridge"">"
0244End Select
0245strTable_Local = strTable_Local & strElement
0246'Set up Table Headings
0247strElement = "<tr>"
0248For i = 1 To iCols
0249 strCell = rs.Fields(i - 1).Name
0250 Select Case strParameter
0251 Case 3
0252 If i = 1 Then
0253 strElement = strElement & "<th class = ""BridgeLeft"">" & strCell & "</th>"
0254 Else
0255 strElement = strElement & "<th class = ""BridgeCenter"">" & strCell & "</th>"
0256 End If
0257 Case 7
0258 If i = 1 Or i = 5 Then
0259 strElement = strElement & "<th class = ""BridgeLeft"">" & strCell & "</th>"
0260 Else
0261 strElement = strElement & "<th class = ""BridgeCenter"">" & strCell & "</th>"
0262 End If
0263 Case 8
0264 If i = 1 Or i = 2 Then
0265 strElement = strElement & "<th class = ""BridgeLeft"">" & strCell & "</th>"
0266 Else
0267 strElement = strElement & "<th class = ""BridgeCenter"">" & strCell & "</th>"
0268 End If
0269 Case 11
0270 If i = 4 Then
0271 strElement = strElement & "<th class = ""BridgeLeft"">" & strCell & "</th>"
0272 Else
0273 strElement = strElement & "<th class = ""BridgeCenter"">" & strCell & "</th>"
0274 End If
0275 Case 15, 17, 18, 23, 24, 25, 27, 28, 29, 30, 32, 34
0276 strElement = strElement & "<th class = ""BridgeLeft"">" & strCell & "</th>"
0277 Case 20
0278 Col_Width = Round(100 / iCols, 1)
0279 strElement = strElement & "<th width = """ & Col_Width & "%"" align = ""Center"">" & strCell & "</th>"
0280 Case 21
0281 Select Case strParameter2
0282 Case 1, 4
0283 If i > 2 Then
0284 strCell = Mid(strCell, 4)
0285 End If
0286 Case 2, 5
0287 If i > 3 Then
0288 strCell = Mid(strCell, 4)
0289 End If
0290 Case 3
0291 If i > 5 Then
0292 strCell = Mid(strCell, 4)
0293 End If
0294 End Select
0295 strElement = strElement & "<th>" & strCell & "</th>"
0296 Case 22
0297 If i = 2 Or i = 3 Then
0298 strElement = strElement & "<th class = ""BridgeCenter"">" & strCell & "</th>"
0299 Else
0300 strElement = strElement & "<th class = ""BridgeLeft"">" & strCell & "</th>"
0301 End If
0302 Case 26
0303 strElement = strElement & "<th class = ""BridgeCenter"">" & strCell & "</th>"
0304 Case 31
0305 strElement = strElement & "<th class = ""BridgeLeft"">" & strCell & "</th>"
0306 Case Else
0307 strElement = strElement & "<th>" & strCell & "</th>"
0308 End Select
0309 If i = iTotal_Col And strParameter <> 3 Then
0310 strElement = strElement & "<th>TOTAL</th>"
0311 End If
0312Next i
0313strElement = strElement & "</tr>"
0314strHeader = strElement & Chr$(10)
0315If strParameter = 30 Or strParameter = 30 Then 'Err .... ********************
0316 strElement = ""
0317End If
0318strTable_Local = strTable_Local & strElement & Chr$(10)
0319'Set up Table Rows
0320strCell_1_Saved = ""
0321strCell_4_Saved = ""
0322strElement = ""
0323Do Until rs.EOF
0324 If strParameter = 11 Or strParameter = 22 Or (strParameter = 21 And (Val(strParameter2_Local) <> 3)) Then
0325 If (strCell_1_Saved <> rs.Fields(0)) And (strElement <> "") Then
0326 'Insert a blank row
0327 strElement = strElement & "<tr>"
0328 For i = 1 To iCols
0329 strElement = strElement & "<td>&nbsp;</td>"
0330 Next i
0331 strElement = strElement & "</tr>"
0332 'Insert the header row
0333 strElement = strElement & strHeader
0334 End If
0335 End If
0336 'strElement = strElement & "<tr>"
0337 j = 0
0338 For i = 1 To iCols
0339 Select Case i
0340 Case 1
0341 strWork = "<tr>"
0342 strCell = rs.Fields(0) & ""
0343 If strParameter = 7 Or strParameter = 8 Or strParameter = 11 Or strParameter = 22 Or strParameter = 24 Or strParameter = 30 Or (strParameter = 21 And (Val(strParameter2_Local) <> 3)) Then
0344 If (strCell_1_Saved = strCell) And strCell & "" <> "" Then
0345 strCell = "&uarr;&uarr;&uarr;"
0346 Else
0347 strCell_1_Saved = strCell
0348 If strParameter = 11 Or strParameter = 22 Then
0349 strCell = "+R" & strCell & IIf(strParameter = 22 And Val(strParameter2_Local) > 2, "Dialogue", "") & "R+" & "<b>" & strCell & "</b>"
0350 Else
0351 If strParameter = 30 Then
0352 strWork = Mid(strCell, 2, InStr(strCell, "]") - 2)
0353 strWork = "PDFs_" & Replace(strWork, " ", "")
0354 strWork = Left(strWork, 20)
0355 strWork = "</table><br><br>+R" & strWork & "R+<table width=1500 class = ""ReadingList"">" & strHeader & "<tr>"
0356 End If
0357 End If
0358 End If
0359 If (strParameter = 11 And rs.Fields(1) <> 0) Or strParameter = 22 Then
0360 strCell = "+R" & rs.Fields(1) & IIf(strParameter = 22 And Val(strParameter2_Local) > 2, "Dialogue", "") & "R+ " & strCell
0361 End If
0362 strElement = strElement & strWork & "<td class = ""BridgeLeft"">" & strCell & "</td>"
0363 Else
0364 strElement = strElement & strWork
0365 If strParameter = 3 Or strParameter = 26 Or strParameter = 27 Or strParameter = 28 Or strParameter = 29 Or strParameter = 32 Or strParameter = 34 Then
0366 If strParameter = 26 Then
0367 strCell = "..\..\" & Mid(strCell, Len("C:\Theo's Files\Websites\Theo's Website\") + 1)
0368 strWork2 = Link_Narr_Gen(strCell) & ""
0369 If strWork2 = "" Then
0370 strWork2 = strCell
0371 End If
0372 strCell = "<a href=""" & strCell & """>" & strWork2 & "</a>"
0373 strElement = strElement & "<td class = ""BridgeRight"">" & strCell & "</td>"
0374 Else
0375 strElement = strElement & "<td class = ""BridgeLeft"">" & strCell & "</td>"
0376 End If
0377 Else
0378 If strParameter = 15 Or strParameter = 17 Or strParameter = 18 Or strParameter = 23 Or strParameter = 24 Or strParameter = 25 Or strParameter = 30 Or strParameter = 31 Then
0379 strElement = strElement & "<td class = ""BridgeLeft"">" & strCell & "</td>"
0380 Else
0381 strElement = strElement & "<td>" & strCell & "</td>"
0382 End If
0383 End If
0384 End If
0385 Case Else
0386 strCell = rs.Fields(i - 1) & ""
0387 If strCell = "" Then
0388 strCell = "&nbsp;"
0389 Else
0390 If strParameter = 3 Then
0391 If i > 6 Then
0392 strCell = Round(strCell, 2)
0393 End If
0394 End If
0395 If i <= iTotal_Col Then
0396 j = j + Val(strCell)
0397 End If
0398 k(i) = k(i) + Val(strCell)
0399 If strParameter <> 3 And strParameter <> 26 And strParameter <> 28 And strParameter <> 29 And strParameter <> 32 Then
0400 OK = Number_Format(strCell)
0401 End If
0402 End If
0403 If (i = 5 And strParameter = 7) Or (i = 2 And strParameter = 15) Or (i = 2 And strParameter = 17) Or (i = 2 And strParameter = 18) Then
0404 If strCell_4_Saved = strCell Then
0405 strCell = "&uarr;&uarr;&uarr;"
0406 Else
0407 strCell_4_Saved = strCell
0408 End If
0409 End If
0410 If i = 3 And strParameter = 3 Then
0411 If strCell = "-" Then
0412 strCell = "&nbsp;"
0413 Else
0414 strCell = Oboe_File_Links_List(strCell)
0415 End If
0416 End If
0417 If (strParameter = 3 And i > 1) Or (strParameter = 7 And i < 5) Or (strParameter = 8 And i > 2) Or (strParameter = 11 And i < 4) Then
0418 strElement = strElement & "<td class=""BridgeCenter"">" & strCell & "</td>"
0419 Else
0420 If strParameter = 11 And i = 4 Then
0421 If rs.Fields(1) = "0" Then
0422 strCell = "<b>Administration</b>|..||.|" & strCell & ": " & Language_Animadversion_Reference_List(rs.Fields(0))
0423 'Add old time
0424 strCell = strCell & Subject_Hours_List(rs.Fields(0))
0425 strQuery = "SELECT Language_Location_Primer.Language_Key, Language_Location_Primer.[Non_Latin_Script?], Language_Location_Primer.Ling_Progress FROM Language_Location_Primer WHERE (((Language_Location_Primer.Language_Key)=""" & rs.Fields(0) & """));"
0426 Set rs_Temp = CurrentDb.OpenRecordset(strQuery)
0427 rs_Temp.MoveFirst
0428 If rs_Temp.Fields(2) > 0 Then
0429 'Add latest Ling Lesson
0430 strCell = strCell & "|.|<b>Latest Ling Lesson Studied: </b>" & rs_Temp.Fields(2)
0431 'Add Links to Ling XTabs
0432 strCell = strCell & "|.|<b>Links to Aeon Comparative Database: </b>|99|"
0433 If rs_Temp.Fields(1) = True Then
0434 strCell = strCell & "|1|Vocabulary++1322#" & rs.Fields(0) & "++|1|Dialogues++1324#" & rs.Fields(0) & "Dialogue++"
0435 Else
0436 strCell = strCell & "|1|Vocabulary++1321#" & rs.Fields(0) & "++|1|Dialogues++1323#" & rs.Fields(0) & "Dialogue++"
0437 End If
0438 strCell = strCell & "|99|"
0439 Set rs_Temp = Nothing
0440 End If
0441 'Finish off
0442 strCell = strCell & "|..|"
0443 Else
0444 strCell = Language_Animadversion_Translate(strCell, rs.Fields(0))
0445 End If
0446 End If
0447 If (strParameter = 7 And i = 5) Or (strParameter = 8 And i = 2) Or (strParameter = 11 And i = 4) Or strParameter = 15 Or strParameter = 17 Or strParameter = 18 Or strParameter = 22 Or strParameter = 30 Or (strParameter = 21 And (Val(strParameter2_Local) <> 3)) Then
0448 strElement = strElement & "<td class=""BridgeLeft"">" & strCell & "</td>"
0449 Else
0450 If strParameter = 23 Then
0451 If i = 2 Or i = 4 Or i = 7 Then
0452 strElement = strElement & "<td class=""BridgeLeft"">" & strCell & "</td>"
0453 Else
0454 strElement = strElement & "<td class=""BridgeCenter"">" & strCell & "</td>"
0455 End If
0456 Else
0457 If strParameter = 24 Or strParameter = 25 Or strParameter = 28 Or strParameter = 29 Or strParameter = 31 Or strParameter = 32 Then
0458 strElement = strElement & "<td class=""BridgeLeft"">" & strCell & "</td>"
0459 Else
0460 If strParameter = 26 Then
0461 Select Case i
0462 Case 2, 3
0463 strElement = strElement & "<td class=""BridgeCenter"">" & strCell & "</td>"
0464 Case 4
0465 OK = Number_Format(strCell)
0466 strElement = strElement & "<td class=""BridgeRight"">" & strCell & "</td>"
0467 Case 5
0468 strCell = "&nbsp;"
0469 m = InStr(rs.Fields(0), "NotesPrint_")
0470 If m > 0 Then
0471 m = m + 11
0472 n = InStr(m, rs.Fields(0), "_")
0473 If n > 0 Then
0474 m = Mid(rs.Fields(0), m, n - m)
0475 strCell = "[Note Link]++" & m & "++"
0476 End If
0477 End If
0478 strElement = strElement & "<td class=""BridgeLeft"">" & strCell & "</td>"
0479 End Select
0480 Else
0481 strElement = strElement & "<td format="","">" & strCell & "</td>"
0482 End If
0483 End If
0484 End If
0485 End If
0486 End If
0487 If i = iTotal_Col Then
0488 'Row Total
0489 strCell = j
0490 If strParameter <> 3 Then
0491 OK = Number_Format(strCell)
0492 strElement = strElement & "<th>" & strCell & "</th>"
0493 End If
0494 k(iCols + 1) = k(iCols + 1) + j
0495 End If
0496 End Select
0497 Next i
0498 strElement = strElement & "</tr>" & Chr$(10)
0499 rs.MoveNext
0500Loop
0501strTable_Local = strTable_Local & strElement
0502'Set up Total Line
0503If iCols >= iTotal_Col Then 'Allow for no Total Row
0504 If strParameter = 3 Then
0505 strElement = "<tr><th class=""BridgeCenter"">TOTALS &rarr;</th>"
0506 Else
0507 strElement = "<tr><th>TOTAL</th>"
0508 End If
0509 For i = 2 To iCols
0510 strCell = k(i)
0511 If strParameter <> 3 Then
0512 OK = Number_Format(strCell)
0513 End If
0514 If strCell = 0 Then
0515 strCell = "&nbsp;"
0516 End If
0517 If strParameter = 3 Then
0518 If i < 5 Then
0519 strElement = strElement & "<th class=""BridgeCenter"">" & "&nbsp;" & "</th>"
0520 Else
0521 strElement = strElement & "<th class=""BridgeCenter"">" & strCell & "</th>"
0522 End If
0523 Else
0524 strElement = strElement & "<th>" & strCell & "</th>"
0525 If i = iTotal_Col Then
0526 strCell = k(iCols + 1)
0527 OK = Number_Format(strCell)
0528 strElement = strElement & "<th>" & strCell & "</th>"
0529 End If
0530 End If
0531 Next i
0532 strElement = strElement & "<tr>" & Chr$(10)
0533 strTable_Local = strTable_Local & strElement
0534End If
0535'Set up Table Footer
0536If strParameter = 3 Or strParameter = 11 Or strParameter = 22 Or (strParameter = 21 And (Val(strParameter2_Local) <> 3)) Then
0537 strTable_Local = strTable_Local & strHeader 'Repeat the column headers
0538End If
0539strElement = "</table>"
0540strTable_Local = strTable_Local & strElement
0541'Tidy up and exit
0542Functor_21 = "Yes"
0543strTable = strTable_Local
0544Set rs = Nothing
0545End Function

Procedures Calling This Procedure (Functor_21) Procedures Called By This Procedure (Functor_21) Tables / Queries / Fragments Directly Used By This Procedure (Functor_21) Go To Start of This Procedure
Go To Top of This Page
Link to VBA Code Control Page



Source Code of: Functor_22
Procedure Type: Public Function
Module: Functors
Lines of Code: 326
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Function Functor_22(strParameter, strList, Note_ID, str_Parameter_2, Optional str_Parameter_3, Optional str_Parameter_4) 'str_Parameter_3 & _4 to be used for recursion
0002'This function formats a list (together with surrounding narrative) from a query
0003Dim rs As Recordset
0004Dim strList_Local As String
0005Dim strElement As String
0006Dim strCell As String
0007Dim strQuery As String
0008Dim strUpdtQuery As String
0009Dim BP As String
0010Dim FN As String
0011Dim str_Parameter_2_Local As String
0012Dim str_Parameter_3_Local As String
0013Dim str_Parameter_4_Local As String
0014Dim strPara2 As String
0015Dim strPara3 As String
0016Dim Item_Year As String
0017Dim Write_Up_Note As Long
0018Dim Field_1 As String
0019Dim Field_2 As String
0020Dim Field_3 As String
0021Dim Field_4 As String
0022Dim Chapter_FieldName As String
0023str_Parameter_2_Local = str_Parameter_2 & ""
0024If IsMissing(str_Parameter_3) Then
0025 str_Parameter_3_Local = ""
0026Else
0027 str_Parameter_3_Local = str_Parameter_3 & ""
0028End If
0029If IsMissing(str_Parameter_4) Then
0030 str_Parameter_4_Local = ""
0031Else
0032 str_Parameter_4_Local = str_Parameter_4 & ""
0033End If
0034strPara3 = ""
0035'For Cases 6 to 7 ... Note that this processing is performed for cases 8 & 9 on re-entry
0036If strParameter >= 6 And strParameter <= 7 Then
0037 If automatic_processing <> "Yes" Then
0038 'Check Books & Papers on PID_Note_Reading_Lists exist!
0039 Set rs = CurrentDb.OpenRecordset("PID_Note_Reading_Lists_Books_Chk")
0040 If Not rs.EOF Then
0041 DoCmd.OpenQuery ("PID_Note_Reading_Lists_Books_Chk")
0042 End If
0043 Set rs = Nothing
0044 Set rs = CurrentDb.OpenRecordset("PID_Note_Reading_Lists_Papers_Chk")
0045 If Not rs.EOF Then
0046 DoCmd.OpenQuery ("PID_Note_Reading_Lists_Papers_Chk")
0047 End If
0048 Set rs = Nothing
0049 'Add new rows to PID_Note_Reading_Lists
0050 DoCmd.OpenQuery ("PID_Notes_Books_Referenced_Gen")
0051 DoCmd.OpenQuery ("PID_Notes_Papers_Referenced_Gen")
0052 DoCmd.OpenQuery ("IdentityBooks_Unreferenced_Gen")
0053 DoCmd.OpenQuery ("IdentityPapersRead_Unreferenced_Gen")
0054 ' Update/add the authors, titles and the "read" & "annotation" status of the papers on PID_Note_Reading_Lists
0055 strUpdtQuery = "UPDATE PID_Note_Reading_Lists INNER JOIN Papers ON PID_Note_Reading_Lists.Called_ID = Papers.ID SET PID_Note_Reading_Lists.[Percent_Read] = Papers.[Actual - Total] / Papers.Estimate * 100, PID_Note_Reading_Lists.[Read?] = [Papers]![Read?], PID_Note_Reading_Lists.Author = [Papers]![Author], PID_Note_Reading_Lists.Title = [Papers]![Title], PID_Note_Reading_Lists.[Annotations?] = [Papers]![Annotations?], PID_Note_Reading_Lists.[Abstract_Null?] = IIf([Abstract] & """"="""",True,False), PID_Note_Reading_Lists.[Link_Internal?] = IIf(InStr([Comments] & """",""+F"")>0,True,False), PID_Note_Reading_Lists.[Link_External?] = IIf(InStr([Comments] & """",""+W"")>0,True,False) WHERE (((PID_Note_Reading_Lists.[Book/Paper])=""Paper"") AND ((PID_Note_Reading_Lists.Note_ID)=" & Note_ID & "));"
0056 DoCmd.RunSQL (strUpdtQuery)
0057 ' Update/add the authors, titles and the "read" status of the books on PID_Note_Reading_Lists
0058 strUpdtQuery = "UPDATE PID_Note_Reading_Lists INNER JOIN Books ON PID_Note_Reading_Lists.Called_ID = Books.ID1 SET PID_Note_Reading_Lists.[Percent_Read] = Books.[Actual - Total] / Books.Estimate * 100, PID_Note_Reading_Lists.[Read?] = [Books]![Read?], PID_Note_Reading_Lists.Author = [Books]![Author], PID_Note_Reading_Lists.Title = [Books]![Title] WHERE (((PID_Note_Reading_Lists.[Book/Paper])=""Book"") AND ((PID_Note_Reading_Lists.Note_ID)=" & Note_ID & "));"
0059 DoCmd.RunSQL (strUpdtQuery)
0060 'Update to show Write-up Notes
0061 strUpdtQuery = "UPDATE PID_Note_Reading_Lists INNER JOIN Papers ON PID_Note_Reading_Lists.Called_ID = Papers.ID SET PID_Note_Reading_Lists.[Write-Up?] = [Papers]![Write_Up_Note_ID] WHERE (((Papers.Write_Up_Note_ID)>0) AND ((PID_Note_Reading_Lists.[Book/Paper])=""Paper"") AND ((PID_Note_Reading_Lists.Note_ID)=" & Note_ID & "));"
0062 DoCmd.RunSQL (strUpdtQuery)
0063 End If
0064 'Check if R/L to be de-duplicated
0065 If str_Parameter_3_Local = "De-Duplicate" Then
0066 'Determine the column name in PID_Note_Reading_Lists table
0067 strQuery = "SELECT Thesis_Chapters.ID, Thesis_Chapters.Chapter FROM Thesis_Chapters WHERE (((Thesis_Chapters.ID)=" & str_Parameter_4 & "));"
0068 Set rs = CurrentDb.OpenRecordset(strQuery)
0069 If Not rs.EOF Then
0070 rs.MoveFirst
0071 Chapter_FieldName = rs.Fields(1)
0072 Chapter_FieldName = "Ch_" & Chapter_FieldName & "_Ist_Note"
0073 strPara3 = " AND ((PID_Note_Reading_Lists." & Chapter_FieldName & ")<>999999)"
0074 End If
0075 Set rs = Nothing
0076 End If
0077End If
0078'For Cases 6 to 9 ...
0079If strParameter >= 6 And strParameter <= 9 Then
0080 'Over-ride Parameter_2 (Category) if requested, else select only that Category
0081 If str_Parameter_2_Local = "*ALL*" Then
0082 strPara2 = ""
0083 Else
0084 If str_Parameter_2_Local = "" Then
0085 strPara2 = " AND ((PID_Note_Reading_Lists.Category) & """" = """")"
0086 Else
0087 strPara2 = " AND ((PID_Note_Reading_Lists.Category)=""" & str_Parameter_2_Local & """)"
0088 End If
0089 End If
0090 'Adjust for items that have missed the cut
0091 If str_Parameter_3_Local = "" Then
0092 strPara3 = ""
0093 Else
0094 If str_Parameter_3_Local = "1" Or str_Parameter_3_Local = "De-Duplicate" Then
0095 strPara3 = " AND ((PID_Note_Reading_Lists.[Missed_Cut?]) = False)"
0096 Else
0097 strPara3 = " AND ((PID_Note_Reading_Lists.[Missed_Cut?]) = True)"
0098 End If
0099 End If
0100End If
0101Select Case strParameter
0102 Case 1
0103 strQuery = "Cross_Reference_By_Year"
0104 strElement = "However, there are (as of " & Now() & ", using +CFunctor_22C+ & query +QCross_Reference_By_YearQ+) the following counts of records on the table with timestamps in the years below:- "
0105 Case 2
0106 strQuery = "Cross_Reference_Changes_By_Year"
0107 strElement = ""
0108 Case 3
0109 DoCmd.OpenQuery ("Functor_Descriptions_GEN")
0110 strQuery = "Functor_Descriptions_List"
0111 strElement = ""
0112 Case 4
0113 strQuery = "Cross_Reference_Changes_By_Month"
0114 strElement = ""
0115 Case 5
0116 strQuery = "PID_Notes_Unused_By_Thesis"
0117 strElement = ""
0118 Case 6
0119 strQuery = "SELECT PID_Note_Reading_Lists.[Book/Paper], PID_Note_Reading_Lists.Called_ID, PID_Note_Reading_Lists.Footnote, PID_Note_Reading_Lists.Author, PID_Note_Reading_Lists.Title, PID_Note_Reading_Lists.Item_Year, PID_Note_Reading_Lists.[Write-Up?], PID_Note_Reading_Lists.[Annotations?], PID_Note_Reading_Lists.[Abstract_Null?], PID_Note_Reading_Lists.[Link_External?], PID_Note_Reading_Lists.[Link_Internal?], PID_Note_Reading_Lists.[Percent_Read], PID_Note_Reading_Lists.[Reason_Missed_Cut] FROM PID_Note_Reading_Lists WHERE (((PID_Note_Reading_Lists.Note_ID) = " & Note_ID & ") And ((PID_Note_Reading_Lists.[Read?]) = Yes) And ((PID_Note_Reading_Lists.[Suppress?]) = No)" & strPara2 & strPara3 & ") ORDER BY PID_Note_Reading_Lists.Author, PID_Note_Reading_Lists.Title;"
0120 strElement = ""
0121 Case 7
0122 strQuery = "SELECT PID_Note_Reading_Lists.[Book/Paper], PID_Note_Reading_Lists.Called_ID, PID_Note_Reading_Lists.Footnote, PID_Note_Reading_Lists.Author, PID_Note_Reading_Lists.Title, PID_Note_Reading_Lists.Item_Year, PID_Note_Reading_Lists.[Write-Up?], PID_Note_Reading_Lists.[Annotations?], PID_Note_Reading_Lists.[Abstract_Null?], PID_Note_Reading_Lists.[Link_External?], PID_Note_Reading_Lists.[Link_Internal?], PID_Note_Reading_Lists.[Percent_Read], PID_Note_Reading_Lists.[Reason_Missed_Cut] FROM PID_Note_Reading_Lists WHERE (((PID_Note_Reading_Lists.Note_ID) = " & Note_ID & ") And ((PID_Note_Reading_Lists.[Read?]) = No) And ((PID_Note_Reading_Lists.[Suppress?]) = No)" & strPara2 & strPara3 & ") ORDER BY PID_Note_Reading_Lists.Author, PID_Note_Reading_Lists.Title;"
0123 strElement = ""
0124 Case 8
0125 If str_Parameter_2_Local = "" Then
0126 strQuery = "SELECT PID_Note_Reading_Lists.Category FROM PID_Note_Reading_Lists WHERE (((PID_Note_Reading_Lists.Note_ID) = " & Note_ID & ") And ((PID_Note_Reading_Lists.[Suppress?]) = No) " & strPara3 & " And ((PID_Note_Reading_Lists.[Read?]) = Yes)) GROUP BY PID_Note_Reading_Lists.Category ORDER BY PID_Note_Reading_Lists.Category;"
0127 Else
0128 strQuery = "SELECT Mid([Category],Len(""" & str_Parameter_2_Local & """)+1) AS Expr2 FROM PID_Note_Reading_Lists WHERE (((PID_Note_Reading_Lists.Note_ID) = " & Note_ID & ") And ((PID_Note_Reading_Lists.[Suppress?]) = No) " & strPara3 & " And ((PID_Note_Reading_Lists.[Read?]) = Yes) And ((Left([Category], Len(""" & str_Parameter_2_Local & """))) = """ & str_Parameter_2_Local & """)) GROUP BY Mid([Category],Len(""" & str_Parameter_2_Local & """)+1) ORDER BY Mid([Category],Len(""" & str_Parameter_2_Local & """)+1);"
0129 End If
0130 strElement = ""
0131 Case 9
0132 If str_Parameter_2_Local = "" Then
0133 strQuery = "SELECT PID_Note_Reading_Lists.Category FROM PID_Note_Reading_Lists WHERE (((PID_Note_Reading_Lists.Note_ID) = " & Note_ID & ") And ((PID_Note_Reading_Lists.[Suppress?]) = No) " & strPara3 & " And ((PID_Note_Reading_Lists.[Read?]) = No)) GROUP BY PID_Note_Reading_Lists.Category ORDER BY PID_Note_Reading_Lists.Category;"
0134 Else
0135 strQuery = "SELECT Mid([Category],Len(""" & str_Parameter_2_Local & """)+1) AS Expr2 FROM PID_Note_Reading_Lists WHERE (((PID_Note_Reading_Lists.Note_ID) = " & Note_ID & ") And ((PID_Note_Reading_Lists.[Suppress?]) = No) " & strPara3 & " And ((PID_Note_Reading_Lists.[Read?]) = No) And ((Left([Category], Len(""" & str_Parameter_2_Local & """))) = """ & str_Parameter_2_Local & """)) GROUP BY Mid([Category],Len(""" & str_Parameter_2_Local & """)+1) ORDER BY Mid([Category],Len(""" & str_Parameter_2_Local & """)+1);"
0136 End If
0137 strElement = ""
0138 Case 10
0139 If str_Parameter_2_Local = "Read" Then
0140 strPara2 = "((Functor_Usage.Functor_Option)=6 Or (Functor_Usage.Functor_Option)=8) "
0141 Else
0142 strPara2 = "((Functor_Usage.Functor_Option)=7 Or (Functor_Usage.Functor_Option)=9) "
0143 End If
0144 strQuery = "SELECT Thesis_Note_XRef.Thesis_Chapter_Note_ID, Thesis_Note_XRef.PID_Note_Seq, Thesis_Note_XRef.PID_Note_Category_1, Thesis_Note_XRef.PID_Note_Category_2, Thesis_Note_XRef.PID_Note_Category_3, Thesis_Note_XRef.PID_Note_Level, Thesis_Note_XRef.PID_Note_ID, Thesis_Note_XRef.PID_Note_Caption, Functor_Usage.Functor_Option, Functor_Usage.Functor_Parameter FROM Thesis_Note_XRef INNER JOIN Functor_Usage ON Thesis_Note_XRef.PID_Note_ID = Functor_Usage.Note_ID WHERE (" & strPara2 & " And ((Functor_Usage.Functor_ID) = 22) And ((Thesis_Note_XRef.Thesis_Chapter_Note_ID) = " & Note_ID & ") And ((Thesis_Note_XRef.[Exclude?]) = No)) ORDER BY Thesis_Note_XRef.PID_Note_Seq, Thesis_Note_XRef.PID_Note_Category_1, Thesis_Note_XRef.PID_Note_Category_2, Thesis_Note_XRef.PID_Note_Category_3, Thesis_Note_XRef.PID_Note_Level, Thesis_Note_XRef.PID_Note_Caption;"
0145 OK = Update_Thesis_Chapter_RLs(Note_ID)
0146 strElement = ""
0147 Case 11
0148 strQuery = "PID_Notes_Unused_By_Thesis_Note_Lists"
0149 strElement = ""
0150 Case 12
0151 strQuery = "PDF_File_List"
0152 strElement = ""
0153 Case 13
0154 strQuery = "Thesis_Reading_List"
0155 strElement = ""
0156End Select
0157Set rs = CurrentDb.OpenRecordset(strQuery)
0158strList_Local = ""
0159If rs.EOF Then
0160 Set rs = Nothing
0161 Debug.Print Now(); "- Functor_22: Option " & strParameter & " (Note = " & Note_ID & ") - No list to print"
0162 If strParameter = 6 Or strParameter = 7 Then
0163 strElement = "|ii|"
0164 strElement = strElement & "|1|No items to list. "
0165 strElement = strElement & "|ii|"
0166 Functor_22 = "Yes"
0167 strList = strElement
0168 Else
0169 Functor_22 = "No"
0170 End If
0171 Exit Function
0172Else
0173 rs.MoveFirst
0174End If
0175'Set up List Header
0176Select Case strParameter
0177 Case 6, 7
0178 strElement = strElement & "|ii|"
0179 Case 10
0180 strElement = "|II|"
0181 Field_3 = ""
0182 Field_4 = ""
0183 Case 8, 9, 12
0184 strElement = "|##|"
0185 Case Else
0186 strElement = strElement & "|99|"
0187End Select
0188strList_Local = strList_Local & strElement
0189strElement = ""
0190Do Until rs.EOF
0191 Field_2 = ""
0192 Select Case strParameter
0193 Case 5, 11
0194 strElement = strElement & "|.|"
0195 strElement = strElement & rs.Fields(0)
0196 Case 6, 7, 13
0197 strElement = strElement & "|1|"
0198 BP = Left(rs.Fields(0), 1)
0199 strElement = strElement & "+" & BP & rs.Fields(1) & BP & "+"
0200 Item_Year = rs.Fields(5) & ""
0201 If Item_Year <> "" Then
0202 strElement = strElement & ", " & Item_Year
0203 End If
0204 If BP = "B" Then
0205 strElement = strElement & ", " & "Book"
0206 End If
0207 Write_Up_Note = rs.Fields(6)
0208 If Write_Up_Note > 0 Then
0209 strElement = strElement & ", [Write-Up Note]++" & Write_Up_Note & "++"
0210 End If
0211 If rs.Fields(7) = True Then
0212 strElement = strElement & ", Annotations"
0213 End If
0214 If rs.Fields(8) = True And Write_Up_Note = 0 Then
0215 strElement = strElement & ", No Abstract"
0216 End If
0217 If rs.Fields(9) = True Then
0218 strElement = strElement & ", External Link"
0219 End If
0220 If rs.Fields(10) = True Then
0221 strElement = strElement & ", Internal PDF Link"
0222 End If
0223 If strParameter = 7 And rs.Fields(11) > 0 Then
0224 strElement = strElement & ", Read = " & rs.Fields(11) & "%"
0225 End If
0226 If strParameter = 13 Then
0227 If rs.Fields(12) = True Then
0228 strElement = strElement & ", Read"
0229 Else
0230 If rs.Fields(11) > 0 Then
0231 strElement = strElement & ", Read = " & rs.Fields(11) & "%"
0232 End If
0233 End If
0234 End If
0235 FN = rs.Fields(2) & ""
0236 If FN <> "" Then
0237 If (Len(FN) < 31) And InStr(FN, "|") = 0 And InStr(FN, "+") = 0 Then 'Allow for quick comment / characterisation, eg. "Aeon" or "August 2019"
0238 strElement = strElement & ", Note: " & FN
0239 Else
0240 If InStr(FN, "|") = 0 Then
0241 FN = "|..||.|" & FN & "|..|"
0242 End If
0243 strElement = strElement & ", Footnote++FN" & FN & "++"
0244 End If
0245 End If
0246 If str_Parameter_3_Local = "2" Then
0247 If rs.Fields(12) & "" <> "" Then
0248 strElement = strElement & ", Missed Cut: " & rs.Fields(12)
0249 End If
0250 End If
0251 Case 8, 9
0252 strElement = strElement & "|.|"
0253 strElement = strElement & "<b>" & IIf(rs.Fields(0) & "" = "", "General", rs.Fields(0)) & "</b>: "
0254 OK = Functor_22(IIf(strParameter = 8, 6, 7), strCell, Note_ID, str_Parameter_2_Local & rs.Fields(0), str_Parameter_3_Local, str_Parameter_4_Local)
0255 strElement = strElement & strCell
0256 Case 10
0257 If rs.Fields(3) & "" <> Field_4 Then
0258 If Field_4 <> "" Then
0259 Field_2 = Field_2 & "|oo|"
0260 End If
0261 If rs.Fields(3) & "" <> "" Then
0262 Field_2 = Field_2 & "|1|" & rs.Fields(3)
0263 End If
0264 Field_4 = rs.Fields(3) & ""
0265 If Field_4 <> "" Then
0266 Field_2 = Field_2 & "|oo|"
0267 End If
0268 End If
0269 If rs.Fields(2) & "" <> Field_3 Then
0270 If Field_3 <> "" Then
0271 Field_2 = Field_2 & "|AA|"
0272 End If
0273 If rs.Fields(2) & "" <> "" Then
0274 Field_2 = Field_2 & "|1|" & rs.Fields(2) & "|AA|"
0275 End If
0276 Field_3 = rs.Fields(2) & ""
0277 End If
0278 Field_1 = rs.Fields(5)
0279 Select Case Field_1
0280 Case "1"
0281 Field_2 = Field_2 & "|1|"
0282 Case "2"
0283 Field_2 = Field_2 & "|1|"
0284 Case "3"
0285 Field_2 = Field_2 & "|.|"
0286 End Select
0287 Field_2 = Field_2 & "<b>[" & rs.Fields(7) & "]++" & rs.Fields(6) & "++</b>"
0288 strElement = strElement & Field_2
0289 OK = Functor_22(rs.Fields(8), strCell, rs.Fields(6), rs.Fields(9) & "", "De-Duplicate", rs.Fields(0))
0290 strElement = strElement & strCell
0291 Case 12
0292 strElement = strElement & Chr$(10)
0293 strElement = strElement & "|.|" & "<a name=""Off-Page_Link_" & rs.Fields(1) & """></a>" & "<a href = ""../../PDFs/" & rs.Fields(1) & ".pdf"">" & rs.Fields(1) & ".pdf</a> " & rs.Fields(0)
0294 Case Else
0295 strElement = strElement & "|.|"
0296 strElement = strElement & "<b>" & rs.Fields(0) & "</b>: "
0297 strCell = rs.Fields(1)
0298 OK = Number_Format(strCell)
0299 strElement = strElement & strCell
0300 End Select
0301 rs.MoveNext
0302Loop
0303strList_Local = strList_Local & strElement
0304'Set up End List
0305Select Case strParameter
0306 Case 6, 7
0307 strElement = "|ii|"
0308 Case 10
0309 strElement = ""
0310 If Field_4 <> "" Then
0311 strElement = strElement & "|oo|"
0312 End If
0313 If Field_3 <> "" Then
0314 strElement = strElement & "|AA|"
0315 End If
0316 strElement = strElement & "|II|"
0317 Case 13
0318 strElement = "|99|"
0319 Case Else
0320 strElement = "|##|"
0321End Select
0322strList_Local = strList_Local & strElement
0323Functor_22 = "Yes"
0324strList = strList_Local
0325Set rs = Nothing
0326End Function

Procedures Calling This Procedure (Functor_22) Procedures Called By This Procedure (Functor_22) Tables / Queries / Fragments Directly Used By This Procedure (Functor_22) Go To Start of This Procedure
Go To Top of This Page
Link to VBA Code Control Page



Source Code of: Functor_23
Procedure Type: Public Function
Module: Functors
Lines of Code: 288
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Function Functor_23(Note_ID, strOption, strValue, Optional str_Parameter_2)
0002'This function either
0003' ... (Options 1-14 & 21-23) returns a value (together with surrounding narrative) from a query, or
0004' ... (Options 15-19) produce an indented list from a query
0005' ... (Option 20) produces the table for the Thesis Dashboard
0006Dim rs As Recordset
0007Dim strValue_Local As String
0008Dim strElement As String
0009Dim strMsg As String
0010Dim strQuery As String
0011Dim Field_1 As String
0012Dim Field_2 As String
0013Dim Field_3 As String
0014Dim i As Integer
0015Dim j As Integer
0016Dim str_Parameter_2_Local As String
0017Dim strPara2 As String
0018If IsMissing(str_Parameter_2) Then
0019 str_Parameter_2_Local = ""
0020Else
0021 str_Parameter_2_Local = str_Parameter_2
0022End If
0023Select Case strOption
0024 Case "1"
0025 strQuery = "Dud_Cross_References_This_Year"
0026 Case "2"
0027 strQuery = "Cross_Reference_MaxID"
0028 Case "3"
0029 strQuery = "SELECT Count(Cross_Reference_Changes.ID) AS CountOfID FROM Cross_Reference_Changes;"
0030 Case "4"
0031 strQuery = "SELECT Website_Regen_Control.Regen_Mins, Website_Regen_Control.Last_Run, Website_Regen_Control.Division FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Paper_Abstract_Ranges""));"
0032 Case "5"
0033 strQuery = "SELECT Website_Regen_Control.Regen_Mins, Website_Regen_Control.Last_Run, Website_Regen_Control.Division FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Author_Letters""));"
0034 Case "6"
0035 strQuery = "SELECT Website_Regen_Control.Regen_Mins, Website_Regen_Control.Last_Run, Website_Regen_Control.Division FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""BookPaperAbstract_Ranges""));"
0036 Case "7"
0037 strQuery = "SELECT Website_Regen_Control.Regen_Mins, Website_Regen_Control.Last_Run, Website_Regen_Control.Division FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Note_Regen_Ranges""));"
0038 Case "8"
0039 strQuery = "SELECT Website_Regen_Control.Regen_Mins, Website_Regen_Control.Last_Run, Website_Regen_Control.Division FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Note_Archive_Regen_Ranges""));"
0040 Case "9"
0041 strQuery = "SELECT * FROM Oboe_Latest_Lesson;"
0042 Case "10"
0043 strQuery = "SELECT BookPaperControl.Time_To_Regenerate, BookPaperControl.Latest_Update FROM BookPaperControl WHERE (((BookPaperControl.[ID])=""Auto_Reference_Notes_Regen""));"
0044 Case "11"
0045 strQuery = "Hits_Pages_Totals"
0046 Case "12"
0047 strQuery = "Hits_Pages_Totals_LastYear"
0048 Case "13"
0049 strQuery = "SELECT Count(Site_Map.Size) AS Records, Max([Timestamp_Logged]) AS [As At] FROM Site_Map;"
0050 Case "14"
0051 strQuery = "SELECT Website_Regen_Control.Regen_Mins, Website_Regen_Control.Last_Run, Website_Regen_Control.Division FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Book_Summary_Ranges""));"
0052 Case "15"
0053 Select Case str_Parameter_2_Local
0054 Case "1"
0055 strQuery = "Earliest_Lang_Dates"
0056 Case "2"
0057 strQuery = "Ling_Progress"
0058 End Select
0059 Case "16", "18"
0060 strQuery = "SELECT Thesis_Note_XRef.Thesis_Chapter_Note_ID, Thesis_Note_XRef.PID_Note_Seq, Thesis_Note_XRef.PID_Note_Category_1, Thesis_Note_XRef.PID_Note_Category_2, Thesis_Note_XRef.PID_Note_Category_3, Thesis_Note_XRef.PID_Note_Level, Notes.Item_Title, Thesis_Note_XRef.PID_Note_ID, Thesis_Note_XRef.PID_Note_Caption, Thesis_Note_XRef.PID_Footnote, Thesis_Note_XRef.[Exclude?], Thesis_Note_XRef.Reason_Excluded FROM Thesis_Note_XRef INNER JOIN Notes ON Thesis_Note_XRef.PID_Note_ID = Notes.ID WHERE (((Thesis_Note_XRef.Thesis_Chapter_Note_ID) = " & Note_ID & ")) ORDER BY Thesis_Note_XRef.PID_Note_Seq, Thesis_Note_XRef.PID_Note_Category_1, Thesis_Note_XRef.PID_Note_Category_2, Thesis_Note_XRef.PID_Note_Category_3, Thesis_Note_XRef.PID_Note_Level, Notes.Item_Title;"
0061 Case "17", "19"
0062 If str_Parameter_2_Local = "Read" Then
0063 strPara2 = "((Functor_Usage.Functor_Option)=6 Or (Functor_Usage.Functor_Option)=8) "
0064 Else
0065 strPara2 = "((Functor_Usage.Functor_Option)=7 Or (Functor_Usage.Functor_Option)=9) "
0066 End If
0067 strQuery = "SELECT Thesis_Note_XRef.Thesis_Chapter_Note_ID, Thesis_Note_XRef.PID_Note_Seq, Thesis_Note_XRef.PID_Note_Category_1, Thesis_Note_XRef.PID_Note_Category_2, Thesis_Note_XRef.PID_Note_Category_3, Thesis_Note_XRef.PID_Note_Level, Notes.Item_Title, Thesis_Note_XRef.PID_Note_ID, Thesis_Note_XRef.PID_Note_Caption, Functor_Usage.Functor_Option, Functor_Usage.Functor_Parameter FROM (Thesis_Note_XRef INNER JOIN Functor_Usage ON Thesis_Note_XRef.PID_Note_ID = Functor_Usage.Note_ID) INNER JOIN Notes ON Thesis_Note_XRef.PID_Note_ID = Notes.ID WHERE (" & strPara2 & " And ((Thesis_Note_XRef.Thesis_Chapter_Note_ID) = " & Note_ID & ") And ((Functor_Usage.Functor_ID) = 22) And ((Thesis_Note_XRef.[Exclude?]) = No)) ORDER BY Thesis_Note_XRef.PID_Note_Seq, Thesis_Note_XRef.PID_Note_Category_1, Thesis_Note_XRef.PID_Note_Category_2, Thesis_Note_XRef.PID_Note_Category_3, Thesis_Note_XRef.PID_Note_Level, Thesis_Note_XRef.PID_Note_Caption;"
0068 Case "20"
0069 strQuery = "Thesis_Progress_Dashboard_List"
0070 Case "21"
0071 Select Case str_Parameter_2_Local
0072 Case "1"
0073 strQuery = "PID_Notes_Unused_By_Thesis_Count"
0074 Case "2"
0075 strQuery = "PID_Notes_Unused_By_Thesis_Note_Lists_Count"
0076 Case "3"
0077 strQuery = "IdentityBooks_Unreferenced_Count"
0078 Case "4"
0079 strQuery = "IdentityPapersRead_Unreferenced_Count"
0080 Case "5"
0081 strQuery = "Works_Missing_By_Thesis_Chapter_Count"
0082 Case "6"
0083 strQuery = "PID_Papers_Filed_Not_Referenced_Count"
0084 Case "7"
0085 strQuery = "PID_Papers_Referenced_Undated_Count"
0086 Case "8"
0087 strQuery = "PID_Papers_Referenced_No_Abstract_Count"
0088 Case "9"
0089 strQuery = "Large_Page_List_Count"
0090 Case "10"
0091 strQuery = "PDF_Missing_List_Count"
0092 Case "11"
0093 strQuery = "Duplicate_Papers_Count"
0094 Case "12"
0095 strQuery = "PDF_File_List_Count"
0096 Case "13"
0097 strQuery = "Missing_Webref_DisplayText_List_Count"
0098 Case "14"
0099 strQuery = "PID_Missing_Online_Papers_List_Count"
0100 Case "15"
0101 strQuery = "Missing_Webref_DisplayText_List_Books_Count"
0102 Case "16"
0103 strQuery = "Papers_Inconsistently_Electronic_Count"
0104 End Select
0105 Case "22"
0106 strQuery = "SELECT PID_Missing_Online_Papers_List.[PID Note], Sum(1) AS Total, Sum(IIf([Accept?]=""Yes"",1,0)) AS Accepted, Sum(IIf([Pending?]=""Yes"",1,0)) AS Pending, Sum(IIf([Reserve?]=""Yes"",1,0)) AS Reserve FROM PID_Missing_Online_Papers_List WHERE (((PID_Missing_Online_Papers_List.[PID Note]) Like ""*+" & Note_ID & "+*"")) GROUP BY PID_Missing_Online_Papers_List.[PID Note];"
0107 Case "23"
0108 Select Case str_Parameter_2_Local
0109 Case "1"
0110 strQuery = "PID_Pages_Total"
0111 Case "2"
0112 strQuery = "Paper_Pages_Total"
0113 End Select
0114 Case Else
0115 Debug.Print Now(); "- Note: " & Note_ID & ". Functor_23 : Invalid Option : " & strOption
0116 Functor_23 = "No"
0117 Exit Function
0118End Select
0119If strOption <> "20" Then
0120 Set rs = CurrentDb.OpenRecordset(strQuery)
0121 strValue_Local = ""
0122 If rs.EOF Then
0123 Debug.Print Now(); "- Note: " & Note_ID & ". Functor_23 : No item to print (Option = " & strOption & ")"
0124 Functor_23 = "No"
0125 Exit Function
0126 End If
0127End If
0128Select Case strOption
0129 Case "1"
0130 rs.MoveLast
0131 strElement = rs.Fields(1)
0132 If rs.Fields(0) <> rs.Fields(2) Then
0133 strElement = 0
0134 End If
0135 If strElement = 0 Then
0136 strElement = "no"
0137 strMsg = "encouraging."
0138 Else
0139 strMsg = "<b>worrying. <u>Investigate</u>!</b>"
0140 Debug.Print Now(); "Note: " & Note_ID & ". Functor_23, Option 1 : Non-zero value printed - Investigate!"
0141 End If
0142 strValue_Local = strElement & " record" & IIf(Val(strElement) > 1, "s", "") & " for " & rs.Fields(2) & " prior to the " & rs.Fields(3) & " regeneration, which is " & strMsg
0143 Case "2"
0144 rs.MoveFirst
0145 strElement = rs.Fields(0)
0146 OK = Number_Format(strElement)
0147 strValue_Local = Now() & " it is " & strElement & " - but it's taken " & Year(Now) - 2015
0148 Case "3"
0149 rs.MoveFirst
0150 strElement = rs.Fields(0)
0151 OK = Number_Format(strElement)
0152 strValue_Local = strElement & " rows, as of " & Left(Now(), 10) & ", "
0153 Case "4", "5", "6", "7", "8", "10", "14"
0154 rs.MoveFirst
0155 strElement = rs.Fields(0)
0156 If strElement >= 60 Then
0157 strElement = Round(strElement / 60, 2) & " hours"
0158 Else
0159 strElement = strElement & " minutes"
0160 End If
0161 strElement = strElement & " on " & Left(rs.Fields(1), 10)
0162 strValue_Local = strElement
0163 Case "9"
0164 rs.MoveFirst
0165 strValue_Local = rs.Fields(0) & ""
0166 Case "11", "12"
0167 rs.MoveFirst
0168 Field_1 = Nz(rs.Fields(0), 0) 'Min period recorded
0169 Field_2 = Nz(rs.Fields(1), 0) 'Max period recorded
0170 Field_3 = Nz(rs.Fields(2), 0) 'Total Hits
0171 Field_1 = Left(Field_1, 4) * 12 + Right(Field_1, 2)
0172 Field_2 = Left(Field_2, 4) * 12 + Right(Field_2, 2)
0173 Field_1 = Field_2 - Field_1 + 1
0174 Field_2 = Field_1 * 365 / 12
0175 Field_3 = Round(Field_3 / Field_2 / 1000, 1)
0176 strValue_Local = Field_3 & "k or so hits a day over the " & Field_1 & " months up to " & rs.Fields(1)
0177 Case "13"
0178 rs.MoveFirst
0179 strValue_Local = Round(rs.Fields(0) / 1000, 0) & "k pages on my site as at " & Left(rs.Fields(1), 10)
0180 Case "15"
0181 rs.MoveFirst
0182 Select Case str_Parameter_2_Local
0183 Case "1"
0184 strValue_Local = "The next languages in the queue are:- |..|"
0185 Field_3 = ""
0186 Case "2"
0187 strValue_Local = "Progress on Ling (in progress order):- |..|"
0188 Field_2 = ""
0189 End Select
0190 Do Until rs.EOF
0191 Select Case str_Parameter_2_Local
0192 Case "1"
0193 Field_1 = rs.Fields(0) & rs.Fields(1)
0194 Field_2 = rs.Fields(2)
0195 If Field_2 = "0" Then
0196 Field_2 = "Not yet studied"
0197 Else
0198 Field_2 = "Last studied on " & Format(Field_2, "Long Date")
0199 If rs.Fields(4) & "" > "0" Then
0200 Field_2 = Field_2 & "; Last Ling Lesson = " & rs.Fields(4)
0201 End If
0202 If rs.Fields(5) & "" <> "" Then
0203 Field_2 = Field_2 & "; Last Ling Revision = " & rs.Fields(5)
0204 End If
0205 End If
0206 If Field_3 <> Field_1 Then
0207 If Field_3 <> "" Then
0208 strValue_Local = strValue_Local & "|99|"
0209 End If
0210 strValue_Local = strValue_Local & "|.|<b>" & rs.Fields(0) & ": Priority " & rs.Fields(1) & "</b>: |99|"
0211 End If
0212 strValue_Local = strValue_Local & "|1|<b>" & Replace(rs.Fields(3), " (Modern)", "") & "</b>. " & Field_2
0213 Field_3 = Field_1
0214 Case "2"
0215 Field_1 = rs.Fields(0)
0216 If Field_2 <> Field_1 Then
0217 If Field_2 <> "" Then
0218 strValue_Local = strValue_Local & "|99|"
0219 End If
0220 strValue_Local = strValue_Local & "|.|<b>Priority " & Field_1 & "</b>:- |99|"
0221 End If
0222 strValue_Local = strValue_Local & "|1|<b>" & rs.Fields(2) & "</b>: " & rs.Fields(1) & IIf(rs.Fields(3) & "" <> "", " (Revision: " & rs.Fields(3) & ")", "")
0223 Field_2 = Field_1
0224 End Select
0225 rs.MoveNext
0226 Loop
0227 strValue_Local = strValue_Local & "|99||..|"
0228 Case "16"
0229 OK = Functor_Indented_List(rs, strValue_Local)
0230 Case "17"
0231 OK = Update_Thesis_Chapter_RLs(Note_ID)
0232 OK = Functor_Indented_List(rs, strValue_Local, True)
0233 Case "18" 'Test only
0234 OK = Functor_Indented_List_Development(rs, strValue_Local)
0235 Case "19"
0236 OK = Update_Thesis_Chapter_RLs(Note_ID)
0237 OK = Functor_Indented_List_Development(rs, strValue_Local, True)
0238 Case "20"
0239 OK = Thesis_Dashboard_Table_Gen(strValue_Local, strQuery)
0240 Case "21"
0241 rs.MoveFirst
0242 strElement = rs.Fields(0)
0243 If str_Parameter_2_Local = "6" Then
0244 Field_1 = Nz(rs.Fields(1))
0245 End If
0246 OK = Number_Format(strElement)
0247 strValue_Local = "(" & strElement & " item" & IIf(strElement = 1, "", "s") & IIf(str_Parameter_2_Local = "6", ", " & Field_1 & " unactioned", "") & ")"
0248 Case "22"
0249 If rs.EOF Then
0250 strValue_Local = ""
0251 Else
0252 strValue_Local = "|.|"
0253 Field_1 = rs.Fields(0)
0254 Field_1 = Mid(Field_1, 2, InStr(Field_1, "]") - 2)
0255 Field_1 = Replace(Field_1, " ", "")
0256 'Field_1 = "PDFs_" & Field_1
0257 Field_1 = Left("PDFs_" & Field_1, 20)
0258 Field_1 = "For further papers held on-line of potential interest, follow this Link++1317#" & Field_1 & "++."
0259 i = rs.Fields.Count
0260 Field_1 = Field_1 & " Total papers = " & rs.Fields(1)
0261 If i > 2 Then
0262 Field_1 = Field_1
0263 Field_3 = ". Including "
0264 j = 2
0265 Field_2 = ""
0266 Do Until j > i - 1
0267 If rs.Fields(j) > 0 Then
0268 Field_1 = Field_1 & Field_3 & Field_2 & rs.Fields(j).Name & " = " & rs.Fields(j)
0269 Field_2 = ", "
0270 Field_3 = ""
0271 End If
0272 j = j + 1
0273 Loop
0274 Field_1 = Field_1 & "."
0275 End If
0276 strValue_Local = strValue_Local & Field_1
0277 End If
0278 Case "23"
0279 rs.MoveFirst
0280 strElement = rs.Fields(0)
0281 strElement = Round(strElement / 1000, 0)
0282 OK = Number_Format(strElement)
0283 strValue_Local = strElement & "k pages, as at " & Now()
0284 End Select
0285Functor_23 = "Yes"
0286strValue = Trim(strValue_Local)
0287Set rs = Nothing
0288End Function

Procedures Calling This Procedure (Functor_23) Procedures Called By This Procedure (Functor_23) Tables / Queries / Fragments Directly Used By This Procedure (Functor_23) Go To Start of This Procedure
Go To Top of This Page
Link to VBA Code Control Page



Source Code of: Jacks_Non_Prime
Procedure Type: Public Sub
Module: Testing
Lines of Code: 36
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Sub Jacks_Non_Prime()
0002'Prove that 2^10 + 5^12 is non-prime
0003'The program shows:-
0004'... The number is 244,141,649 = 14657 x 16657
0005'... Max Long is 2,147,483,647, so didn't need LongLong
0006Dim Non_Prime As LongLong
0007Dim Non_Prime_Temp As LongLong
0008Dim Non_Prime_Sqrt As Integer
0009Dim i As Integer
0010Non_Prime_Temp = 1
0011For i = 1 To 10
0012 Non_Prime_Temp = Non_Prime_Temp * 2
0013Next i
0014Debug.Print Non_Prime_Temp
0015Non_Prime = Non_Prime_Temp
0016Non_Prime_Temp = 1
0017For i = 1 To 12
0018 Non_Prime_Temp = Non_Prime_Temp * 5
0019Next i
0020Debug.Print Non_Prime_Temp
0021Non_Prime = Non_Prime + Non_Prime_Temp
0022Debug.Print Non_Prime
0023Non_Prime_Sqrt = Non_Prime ^ 0.5
0024Debug.Print Non_Prime_Sqrt
0025Non_Prime_Sqrt = Non_Prime_Sqrt / 2 + 1
0026For i = 1 To Non_Prime_Sqrt
0027 Non_Prime_Temp = Non_Prime Mod (2 * i + 1)
0028 If Non_Prime_Temp = 0 Then
0029 Debug.Print 2 * i + 1
0030 Non_Prime_Temp = Non_Prime / (2 * i + 1)
0031 Debug.Print Non_Prime_Temp
0032 Non_Prime_Temp = Non_Prime_Temp * (2 * i + 1)
0033 Debug.Print Non_Prime_Temp
0034 End If
0035Next i
0036End Sub

Go To Start of This Procedure
Go To Top of This Page
Link to VBA Code Control Page



Source Code of: Number_Format
Procedure Type: Public Function
Module: New Code
Lines of Code: 42
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Function Number_Format(strNumber_Sent)
0002Dim strNumber_Local As String
0003Dim Digit_Table(20) As String
0004Dim i As Integer
0005Dim j As Integer
0006Dim iLen_Number As Integer
0007'This function inserts commas into a number sent ...
0008'I may get it to do further functions in due course
0009' .... I couldn't find an HTML format command to do this
0010' .... but there must be a VBA built-in function?
0011strNumber_Local = Trim(strNumber_Sent)
0012If Not IsNumeric(strNumber_Local) Then
0013 Exit Function
0014End If
0015If Val(strNumber_Local) < 1000 Then 'Can't be any commas
0016 Exit Function
0017End If
0018iLen_Number = Len(strNumber_Local)
0019For i = 1 To 20
0020 Digit_Table(i) = ""
0021Next i
0022'Add the commas (in reverse)
0023j = 1
0024For i = 1 To iLen_Number
0025 Digit_Table(j) = Mid(strNumber_Local, iLen_Number + 1 - i, 1)
0026 j = j + 1
0027 If i Mod 3 = 0 Then
0028 Digit_Table(j) = ","
0029 j = j + 1
0030 End If
0031Next i
0032'Remove trailing comma
0033If Digit_Table(j - 1) = "," Then
0034 Digit_Table(j - 1) = ""
0035End If
0036strNumber_Local = ""
0037For i = 1 To j - 1
0038 strNumber_Local = strNumber_Local & Digit_Table(j - i)
0039Next i
0040'Exit
0041strNumber_Sent = strNumber_Local
0042End Function

Procedures Calling This Procedure (Number_Format) Go To Start of This Procedure
Go To Top of This Page
Link to VBA Code Control Page



© Theo Todman, June 2007 - Sept 2022. Please address any comments on this page to theo@theotodman.com. File output:
Website Maintenance Dashboard
Return to Top of this Page Return to Theo Todman's Philosophy Page Return to Theo Todman's Home Page