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 14 (7 items)

Reference_FootNotesRegen_Note_Book_LinksRegen_Note_Paper_LinksRegen_Author_Book_Links
Regen_Author_Paper_LinksRegen_Book_Note_LinksRegen_Note_Links.

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

Go to top of page




Source Code of: Reference_FootNotes
Procedure Type: Public Function
Module: New Code
Lines of Code: 179
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Function Reference_FootNotes(strType, ID, strText, Optional strTitle)
0002'Segregates the text of Paper and Book abstracts into main text and footnotes, hyperlinked together.
0003'If strType = X, only the footnotes are seived out - this is to check for bullet conflict for book abstracts
0004Dim rsFootnotes As Recordset
0005Dim rsFNCheck As Recordset
0006Dim strQuery As String
0007Dim strFootnote As String
0008Dim x As Long
0009Dim xx As String
0010Dim i As Long
0011Dim No_FN As String
0012Dim FN_Start As Long
0013Dim FN_End As Long
0014Dim iSuperscript As Integer
0015Dim strLink1 As String
0016Dim strLink2 As String
0017Dim TheWord As String
0018Dim strName As String
0019Dim Last_Footnote_Bulletted As String
0020Dim strLine_Break As String
0021Dim FN_Count As Integer
0022Dim BlankSpace As String
0023Dim strDup_FNs As String
0024Dim iSuperscript_Display As Integer
0025'Delete Footnotes from Table
0026 strQuery = "DELETE Abstract_Footnotes.Object_Type, Abstract_Footnotes.Object_ID, Abstract_Footnotes.FN_ID, Abstract_Footnotes.FN_Text, Abstract_Footnotes.Timestamp, Abstract_Footnotes.Master_ID FROM Abstract_Footnotes WHERE (((Abstract_Footnotes.Object_Type)=""" & strType & """) AND ((Abstract_Footnotes.Object_ID)=" & ID & "));"
0027DoCmd.RunSQL (strQuery)
0028'Ready the Footnote Table
0029 strQuery = "SELECT Abstract_Footnotes.Object_Type, Abstract_Footnotes.Object_ID, Abstract_Footnotes.FN_ID, Abstract_Footnotes.FN_Text, Abstract_Footnotes.Timestamp, Abstract_Footnotes.Master_ID FROM Abstract_Footnotes WHERE (((Abstract_Footnotes.Object_Type)=""" & strType & """) AND ((Abstract_Footnotes.Object_ID)=" & ID & ")) ORDER BY Abstract_Footnotes.FN_ID;"
0030Set rsFootnotes = CurrentDb.OpenRecordset(strQuery)
0031iSuperscript = 1
0032FN_Count = 0
0033x = 1
0034x = InStr(x, strText, "++FN")
0035If x > 0 Then
0036 OK = Mark_Colours(strText)
0037 x = 1
0038 No_FN = "No"
0039 x = InStr(x, strText, "++")
0040 Do Until (No_FN = "Yes" And x = 0)
0041 If x > 0 Then
0042 If Mid(strText, x + 2, 2) = "FN" Then
0043 FN_Start = x
0044 x = x + 1
0045 x = InStr(x, strText, "++")
0046 If x > 0 Then
0047 FN_End = x + 1
0048 strFootnote = Mid(strText, FN_Start + 4, FN_End - FN_Start - 5) & ""
0049 If strFootnote = "" Then
0050 'Ignore null Footnotes - only used for documentation purposes!
0051 Else
0052 If Mid(strText, FN_Start - 1, 1) = " " Then
0053 i = FindWord(strText, FN_Start - 1, "]")
0054 Else
0055 i = FindWord(strText, FN_Start, "]")
0056 End If
0057 'Add to Array
0058 rsFootnotes.AddNew
0059 rsFootnotes.Fields(0) = strType
0060 rsFootnotes.Fields(1) = ID
0061 rsFootnotes.Fields(2) = iSuperscript
0062 rsFootnotes.Fields(3) = strFootnote
0063 rsFootnotes.Fields(4) = Now()
0064 rsFootnotes.Fields(5) = iSuperscript
0065 rsFootnotes.Update
0066 'Find if a duplicate FN
0067 OK = Mark_Duplicate_Abstract_Footnotes(strType, ID)
0068 Set rsFNCheck = CurrentDb.OpenRecordset("SELECT Abstract_Footnotes.Object_Type, Abstract_Footnotes.Object_ID, Abstract_Footnotes.FN_ID, Abstract_Footnotes.Master_ID FROM Abstract_Footnotes WHERE (((Abstract_Footnotes.Object_Type)=""" & strType & """) AND ((Abstract_Footnotes.Object_ID)=" & ID & ") AND ((Abstract_Footnotes.FN_ID)=" & iSuperscript & "));")
0069 rsFNCheck.MoveFirst
0070 If rsFNCheck.Fields(2) <> rsFNCheck.Fields(3) Then
0071 iSuperscript_Display = rsFNCheck.Fields(3)
0072 Else
0073 iSuperscript_Display = iSuperscript
0074 End If
0075 Set rsFNCheck = Nothing
0076 strLink1 = "<U><A HREF=""#On-Page_Link_" & strType & ID & "_" & iSuperscript_Display & """>"
0077 'Note ... leave a marker to enable Note referencing later on ...
0078 strLink2 = "</A></U><SUB>" & iSuperscript & IIf(iSuperscript <> iSuperscript_Display, "=" & iSuperscript_Display, "") & "</SUB>" & "<a name=""On-Page_Return_" & strType & ID & "_" & iSuperscript & """></A>++FN++"
0079 If Mid(strText, FN_Start - 1, 1) = " " Then
0080 TheWord = Mid(strText, i, FN_Start - 1 - i)
0081 Else
0082 TheWord = Mid(strText, i, FN_Start - i)
0083 End If
0084 If Right(TheWord, 1) = "]" Then
0085 TheWord = Mid(TheWord, 2, Len(TheWord) - 2)
0086 End If
0087 If Left(TheWord, 1) = "(" Then
0088 TheWord = Mid(TheWord, 2)
0089 i = i + 1
0090 End If
0091 xx = Left(strText, i - 1) & strLink1 & TheWord & strLink2
0092 x = Len(xx)
0093 strText = xx & Mid(strText, FN_End + 1)
0094 iSuperscript = iSuperscript + 1
0095 FN_Count = FN_Count + 1
0096 End If
0097 x = x + 1
0098 x = InStr(x, strText, "++")
0099 End If
0100 Else
0101 No_FN = "Yes"
0102 'Ignore Note-links (ie. links to other Notes)
0103 'watch out for "++++" where the Note ID is to be deduced in due course
0104 If Mid(strText, x, 4) = "++++" Then
0105 x = x + 3
0106 Else
0107 x = x + 1
0108 x = InStr(x, strText, "++")
0109 End If
0110 If x > 0 Then
0111 x = x + 1
0112 x = InStr(x, strText, "++")
0113 iSuperscript = iSuperscript + 1
0114 End If
0115 End If
0116 Else
0117 No_FN = "Yes"
0118 End If
0119 Loop
0120End If
0121 OK = Mark_Duplicate_Abstract_Footnotes(strType, ID) 'Flag duplicate footnotes
0122If strType <> "X" Then
0123 'Write out the footnotes (if any)
0124 iSuperscript = 1
0125 If FN_Count > 0 Then
0126 If IsMissing(strTitle) Then
0127 strName = ""
0128 Else
0129 strName = strTitle
0130 strName = " (" & strName & ")"
0131 End If
0132 strText = strText & "<BR><HR><BR><U><B>In-Page Footnotes</U>" & strName & "</B>"
0133 Last_Footnote_Bulletted = "No"
0134 'Re-read Footnotes
0135 Set rsFootnotes = CurrentDb.OpenRecordset(strQuery)
0136 rsFootnotes.MoveFirst
0137 Do While Not rsFootnotes.EOF
0138 'Format the in-page Footnotes
0139 strFootnote = rsFootnotes.Fields(3) & ""
0140 iSuperscript = rsFootnotes.Fields(2)
0141 If strFootnote <> "" Then
0142 If rsFootnotes(2) = rsFootnotes(5) Then 'Allow for Duplicate FNs
0143 If Last_Footnote_Bulletted = "Yes" Then
0144 strLine_Break = ""
0145 Else
0146 strLine_Break = "<BR><BR>"
0147 End If
0148 BlankSpace = Right(Trim(strFootnote), 20)
0149 If InStr(BlankSpace, "|..|") > 0 Or InStr(BlankSpace, "|99|") > 0 Or InStr(BlankSpace, "|ii|") > 0 Or InStr(BlankSpace, "|II|") > 0 Or InStr(BlankSpace, "|aa|") > 0 Or InStr(BlankSpace, "|AA|") > 0 Or InStr(BlankSpace, "|##|") > 0 Then 'Determine if the footnote ends in a bulleted list. If so, don't add line breaks next time ...
0150 'Changed 16/02/2014 to allow for non-text - eg. |Colour_x| - at the end
0151 Last_Footnote_Bulletted = "Yes"
0152 Else
0153 Last_Footnote_Bulletted = "No"
0154 End If
0155 'Check, and list, Duplicate FNs
0156 strDup_FNs = ""
0157 Set rsFNCheck = CurrentDb.OpenRecordset("SELECT Abstract_Footnotes.Object_Type, Abstract_Footnotes.Object_ID, Abstract_Footnotes.FN_ID, Abstract_Footnotes.Master_ID FROM Abstract_Footnotes WHERE (((Abstract_Footnotes.Object_Type) = """ & strType & """) And ((Abstract_Footnotes.Object_ID) = " & ID & ") And ((Abstract_Footnotes.FN_ID) <> [Abstract_Footnotes]![Master_ID]) And ((Abstract_Footnotes.Master_ID) = " & rsFootnotes(2) & ")) ORDER BY Abstract_Footnotes.FN_ID;")
0158 If Not rsFNCheck.EOF Then
0159 rsFNCheck.MoveFirst
0160 Do While Not rsFNCheck.EOF
0161 strDup_FNs = strDup_FNs & "<A HREF=""#On-Page_Return_" & strType & ID & "_" & rsFNCheck.Fields(2).Value & """>, " & rsFNCheck.Fields(2).Value & "</A>"
0162 rsFNCheck.MoveNext
0163 Loop
0164 End If
0165 Set rsFNCheck = Nothing
0166 strText = strText & "<a name=""On-Page_Link_" & strType & ID & "_" & iSuperscript & """></A>" & strLine_Break & "<U><A HREF=""#On-Page_Return_" & strType & ID & "_" & iSuperscript & """>" & "<B>Footnote" & IIf(strDup_FNs = "", " ", "s ") & iSuperscript & "</A>" & strDup_FNs & "</B></U>: " & strFootnote
0167 End If
0168 End If
0169 rsFootnotes.MoveNext
0170 Loop
0171 BlankSpace = Right(Trim(strText), 20)
0172 If InStr(BlankSpace, "|..|") > 0 Or InStr(BlankSpace, "|99|") > 0 Or InStr(BlankSpace, "|ii|") > 0 Or InStr(BlankSpace, "|II|") > 0 Or InStr(BlankSpace, "|aa|") > 0 Or InStr(BlankSpace, "|AA|") > 0 Or InStr(BlankSpace, "|##|") > 0 Then 'Determine if the footnote ends in a bulleted list. If so, don't add line breaks next time ...
0173 Else
0174 strText = strText & "<BR><BR>"
0175 End If
0176 End If
0177End If
0178Set rsFootnotes = Nothing
0179End Function

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



Source Code of: Regen_Author_Book_Links
Procedure Type: Public Sub
Module: New Code
Lines of Code: 87
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Sub Regen_Author_Book_Links()
0002Dim strControlQuery As String
0003Dim strLine As String
0004Dim rsTableToRead As Recordset
0005Dim rsAuthorBookLinks As Recordset
0006Dim x As Long
0007Dim Y As Long
0008Dim z As Long
0009Dim Names_Found As String
0010Dim Author As String
0011Dim Author_Letter As String
0012'Read Book records
0013 strControlQuery = "SELECT Books.Author, Books.Title, Books.ID1, Books.[Author & Title] FROM Books ORDER BY Books.Author;"
0014Set rsTableToRead = CurrentDb.OpenRecordset(strControlQuery)
0015rsTableToRead.MoveFirst
0016'Ready the Author_Book_Links_Temp Table
0017 DoCmd.RunSQL ("DELETE Author_Book_Links_Temp.* FROM Author_Book_Links_Temp;")
0018 strControlQuery = "SELECT Author_Book_Links_Temp.* FROM Author_Book_Links_Temp;"
0019Set rsAuthorBookLinks = CurrentDb.OpenRecordset(strControlQuery)
0020'Regenerate the Author_Book_Links Table
0021Do While Not rsTableToRead.EOF
0022 strLine = rsTableToRead.Fields(0)
0023 x = 1
0024 Y = InStr(x, strLine, ",")
0025 z = InStr(x, strLine, "&")
0026 Names_Found = "No"
0027 'Interrogate the "Author" column
0028 Do Until Names_Found = "Yes"
0029 If Y + z = 0 Then
0030 Names_Found = "Yes"
0031 Author = Trim(Mid(strLine, x, Len(strLine)))
0032 Else
0033 If z = 0 Then
0034 Author = Trim(Mid(strLine, x, Y - x))
0035 x = Y + 1
0036 Else
0037 If Y = 0 Then
0038 Author = Trim(Mid(strLine, x, z - x))
0039 x = z + 1
0040 Else
0041 If Y > z Then
0042 Author = Trim(Mid(strLine, x, z - x))
0043 x = z + 1
0044 Else
0045 Author = Trim(Mid(strLine, x, Y - x))
0046 x = Y + 1
0047 End If
0048 End If
0049 End If
0050 End If
0051 'Ignore non-alpha's
0052 Author_Letter = UCase(Left(Author, 1))
0053 If Author_Letter < "A" Or Author_Letter > "Z" Then
0054 Author = "Dud"
0055 End If
0056 'Write out Author_Book_Links record
0057 Select Case Author
0058 Case "Dud"
0059 Case "Ed."
0060 Case "Eds."
0061 Case "Etc"
0062 Case "Etc."
0063 Case Else
0064 rsAuthorBookLinks.AddNew
0065 rsAuthorBookLinks!Author = Author
0066 rsAuthorBookLinks!Book_Author = rsTableToRead.Fields(0).Value
0067 rsAuthorBookLinks!Book_Title = rsTableToRead.Fields(1).Value
0068 rsAuthorBookLinks!Book_ID1 = rsTableToRead.Fields(2).Value
0069 rsAuthorBookLinks!Book_Author_Title = rsTableToRead.Fields(3).Value
0070 rsAuthorBookLinks![Timestamp] = Now()
0071 rsAuthorBookLinks.Update
0072 End Select
0073 'More Authors?
0074 If Names_Found = "No" Then
0075 Y = InStr(x, strLine, ",")
0076 z = InStr(x, strLine, "&")
0077 End If
0078 Loop
0079 rsTableToRead.MoveNext
0080Loop
0081'Now update the Author_Book_Links table
0082'Add new Links
0083 DoCmd.RunSQL ("INSERT INTO Author_Book_Links ( Author, Book_Author, Book_Title, Book_ID1, Book_Author_Title, [Timestamp] ) SELECT Author_Book_Links_Temp.Author, Author_Book_Links_Temp.Book_Author, Author_Book_Links_Temp.Book_Title, Author_Book_Links_Temp.Book_ID1, Author_Book_Links_Temp.Book_Author_Title, Author_Book_Links_Temp.Timestamp FROM Author_Book_Links_Temp LEFT JOIN Author_Book_Links ON (Author_Book_Links_Temp.Book_ID1 = Author_Book_Links.Book_ID1) AND (Author_Book_Links_Temp.Author = Author_Book_Links.Author) WHERE (((Author_Book_Links.Author) Is Null));")
0084'Delete unused links
0085 DoCmd.RunSQL ("UPDATE Author_Book_Links LEFT JOIN Author_Book_Links_Temp ON (Author_Book_Links.Book_ID1 = Author_Book_Links_Temp.Book_ID1) AND (Author_Book_Links.Author = Author_Book_Links_Temp.Author) SET Author_Book_Links.Zap_Flag = Yes WHERE (((Author_Book_Links_Temp.Author) Is Null));")
0086 DoCmd.RunSQL ("DELETE Author_Book_Links.Zap_Flag FROM Author_Book_Links WHERE (((Author_Book_Links.Zap_Flag)=Yes));")
0087End Sub

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



Source Code of: Regen_Author_Paper_Links
Procedure Type: Public Sub
Module: New Code
Lines of Code: 87
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Sub Regen_Author_Paper_Links()
0002Dim strControlQuery As String
0003Dim strLine As String
0004Dim rsTableToRead As Recordset
0005Dim rsAuthorPaperLinks As Recordset
0006Dim x As Long
0007Dim Y As Long
0008Dim z As Long
0009Dim Names_Found As String
0010Dim Author As String
0011Dim Author_Letter As String
0012'Read Paper records
0013 strControlQuery = "SELECT Papers.Author, Papers.Title, Papers.ID, Papers.Book FROM Papers ORDER BY Papers.Author;"
0014Set rsTableToRead = CurrentDb.OpenRecordset(strControlQuery)
0015rsTableToRead.MoveFirst
0016'Ready the Author_Paper_Links_Temp Table
0017 DoCmd.RunSQL ("DELETE Author_Paper_Links_Temp.* FROM Author_Paper_Links_Temp;")
0018 strControlQuery = "SELECT Author_Paper_Links_Temp.* FROM Author_Paper_Links_Temp;"
0019Set rsAuthorPaperLinks = CurrentDb.OpenRecordset(strControlQuery)
0020'Regenerate the Author_Paper_Links Table
0021Do While Not rsTableToRead.EOF
0022 strLine = rsTableToRead.Fields(0)
0023 x = 1
0024 Y = InStr(x, strLine, ",")
0025 z = InStr(x, strLine, "&")
0026 Names_Found = "No"
0027 'Interrogate the "Author" column
0028 Do Until Names_Found = "Yes"
0029 If Y + z = 0 Then
0030 Names_Found = "Yes"
0031 Author = Trim(Mid(strLine, x, Len(strLine)))
0032 Else
0033 If z = 0 Then
0034 Author = Trim(Mid(strLine, x, Y - x))
0035 x = Y + 1
0036 Else
0037 If Y = 0 Then
0038 Author = Trim(Mid(strLine, x, z - x))
0039 x = z + 1
0040 Else
0041 If Y > z Then
0042 Author = Trim(Mid(strLine, x, z - x))
0043 x = z + 1
0044 Else
0045 Author = Trim(Mid(strLine, x, Y - x))
0046 x = Y + 1
0047 End If
0048 End If
0049 End If
0050 End If
0051 'Ignore non-alpha's
0052 Author_Letter = UCase(Left(Author, 1))
0053 If Author_Letter < "A" Or Author_Letter > "Z" Then
0054 Author = "Dud"
0055 End If
0056 'Write out Author_Paper_Links record
0057 Select Case Author
0058 Case "Dud"
0059 Case "Ed."
0060 Case "Eds."
0061 Case "Etc"
0062 Case "Etc."
0063 Case Else
0064 rsAuthorPaperLinks.AddNew
0065 rsAuthorPaperLinks!Author = Author
0066 rsAuthorPaperLinks!Paper_Author = rsTableToRead.Fields(0).Value
0067 rsAuthorPaperLinks!Paper_Title = rsTableToRead.Fields(1).Value
0068 rsAuthorPaperLinks!Paper_ID = rsTableToRead.Fields(2).Value
0069 rsAuthorPaperLinks!Paper_Book = rsTableToRead.Fields(3).Value
0070 rsAuthorPaperLinks![Timestamp] = Now()
0071 rsAuthorPaperLinks.Update
0072 End Select
0073 'More Authors?
0074 If Names_Found = "No" Then
0075 Y = InStr(x, strLine, ",")
0076 z = InStr(x, strLine, "&")
0077 End If
0078 Loop
0079 rsTableToRead.MoveNext
0080Loop
0081'Now update the Author_Paper_Links table
0082'Add new Links
0083 DoCmd.RunSQL ("INSERT INTO Author_Paper_Links ( Author, Paper_Author, Paper_Title, Paper_ID, Paper_Book, [Timestamp] ) SELECT Author_Paper_Links_Temp.Author, Author_Paper_Links_Temp.Paper_Author, Author_Paper_Links_Temp.Paper_Title, Author_Paper_Links_Temp.Paper_ID, Author_Paper_Links_Temp.Paper_Book, Author_Paper_Links_Temp.Timestamp FROM Author_Paper_Links_Temp LEFT JOIN Author_Paper_Links ON (Author_Paper_Links_Temp.Paper_ID = Author_Paper_Links.Paper_ID) AND (Author_Paper_Links_Temp.Author = Author_Paper_Links.Author) WHERE (((Author_Paper_Links.Author) Is Null));")
0084'Delete unused links
0085 DoCmd.RunSQL ("UPDATE Author_Paper_Links LEFT JOIN Author_Paper_Links_Temp ON (Author_Paper_Links.Paper_ID = Author_Paper_Links_Temp.Paper_ID) AND (Author_Paper_Links.Author = Author_Paper_Links_Temp.Author) SET Author_Paper_Links.Zap_Flag = Yes WHERE (((Author_Paper_Links_Temp.Author) Is Null));")
0086 DoCmd.RunSQL ("DELETE Author_Paper_Links.Zap_Flag FROM Author_Paper_Links WHERE (((Author_Paper_Links.Zap_Flag)=Yes));")
0087End Sub

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



Source Code of: Regen_Book_Note_Links
Procedure Type: Public Sub
Module: New Code
Lines of Code: 131
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Sub Regen_Book_Note_Links()
0002'This Process maintains the Book_Note_Links table, which records which Books reference which Notes ...
0003'This is in contrast to the Regen_Note_Book_Links Process which maintains the Note_Book_Links table, which records which Notes reference which Books ....
0004'Some day, I ought to combine these two tables ....
0005Dim strControlQuery As String
0006Dim strLine As String
0007Dim rsTableToRead As Recordset
0008Dim rsBookNoteLinks As Recordset
0009Dim x As Long
0010Dim Y As Long
0011Dim i As Long
0012Dim TheWord As String
0013Dim iNoteID As Integer
0014Dim rsNoteID As Recordset
0015'Read Book records
0016 strControlQuery = "SELECT Books.ID1, Books.[Author & Title], Books.Abstract, Books.Comments FROM Books ORDER BY Books.Author;"
0017Set rsTableToRead = CurrentDb.OpenRecordset(strControlQuery)
0018'Ready the Book_Note_Links Table
0019 DoCmd.RunSQL ("DELETE Book_Note_Links.* FROM Book_Note_Links;")
0020 strControlQuery = "SELECT Book_Note_Links.* FROM Book_Note_Links;"
0021Set rsBookNoteLinks = CurrentDb.OpenRecordset(strControlQuery)
0022'Regenerate the Book_Note_Links Table
0023'New-style links
0024rsTableToRead.MoveFirst
0025Do While Not rsTableToRead.EOF
0026 strLine = rsTableToRead.Fields(2) & " " & rsTableToRead.Fields(3)
0027 x = 1
0028 x = InStr(x, strLine, "++")
0029 Do While x > 0
0030 Y = InStr(x + 1, strLine, "++")
0031 If Y > 0 Then
0032 If Y = x + 1 Then
0033 'Check this is the "++++" case where we have to look up the reference
0034 If Mid(strLine, x, 4) = "++++" Then
0035 'Find the key-word(s)
0036 If Mid(strLine, x - 1, 1) = " " Then
0037 i = FindWord(strLine, x - 1, "]")
0038 TheWord = Mid(strLine, i, x - 1 - i)
0039 Else
0040 i = FindWord(strLine, x, "]")
0041 TheWord = Mid(strLine, i, x - i)
0042 End If
0043 If Right(TheWord, 1) = "]" Then
0044 TheWord = Mid(TheWord, 2, Len(TheWord) - 2)
0045 End If
0046 'Find the Note ID. NB uses the Note_Alternates table!
0047 Set rsNoteID = CurrentDb.OpenRecordset("SELECT Notes.ID FROM Note_Alternates INNER JOIN Notes ON Note_Alternates.Item_Title = Notes.Item_Title WHERE (((Note_Alternates.Item_Alt_Title)=""" & TheWord & """));")
0048 If rsNoteID.EOF Then
0049 iNoteID = 1256 'The "dud links" Note!
0050 Else
0051 rsNoteID.MoveFirst
0052 iNoteID = rsNoteID.Fields(0)
0053 End If
0054 Set rsNoteID = Nothing
0055 strLine = Left(strLine, x + 1) & iNoteID & Mid(strLine, x + 2)
0056 Y = Y + 1 + Len(iNoteID)
0057 End If
0058 Else
0059 If IsNumeric(Mid(strLine, x + 2, Y - x - 2)) Then
0060 iNoteID = Mid(strLine, x + 2, Y - x - 2)
0061 'Add the Book_Note_Links link
0062 rsBookNoteLinks.AddNew
0063 rsBookNoteLinks!Book_ID1 = rsTableToRead.Fields(0)
0064 rsBookNoteLinks!Book_Author_Title = rsTableToRead.Fields(1)
0065 rsBookNoteLinks!Note_ID = iNoteID
0066 rsBookNoteLinks![Timestamp] = Now()
0067 rsBookNoteLinks.Update
0068 Else
0069 Y = x + 1
0070 End If
0071 End If
0072 Else
0073 Y = x + 1
0074 End If
0075 x = InStr(Y + 1, strLine, "++")
0076 Loop
0077 rsTableToRead.MoveNext
0078Loop
0079'Old-style links
0080rsTableToRead.MoveFirst
0081Do While Not rsTableToRead.EOF
0082 strLine = rsTableToRead.Fields(2) & " " & rsTableToRead.Fields(3)
0083 x = 1
0084 x = InStr(x, strLine, "+N")
0085 Do While x > 0
0086 Y = InStr(x + 1, strLine, "N+")
0087 If Y = x + 2 Then
0088 'Check this is the "+NN+" case where we have to look up the reference
0089 If Mid(strLine, x, 4) = "+NN+" Then
0090 'Find the key-word(s)
0091 If Mid(strLine, x - 1, 1) = " " Then
0092 i = FindWord(strLine, x - 1, "]")
0093 TheWord = Mid(strLine, i, x - 1 - i)
0094 Else
0095 i = FindWord(strLine, x, "]")
0096 TheWord = Mid(strLine, i, x - i)
0097 End If
0098 If Right(TheWord, 1) = "]" Then
0099 TheWord = Mid(TheWord, 2, Len(TheWord) - 2)
0100 End If
0101 'Find the Note ID. NB uses the Note_Alternates table!
0102 Set rsNoteID = CurrentDb.OpenRecordset("SELECT Notes.ID FROM Note_Alternates INNER JOIN Notes ON Note_Alternates.Item_Title = Notes.Item_Title WHERE (((Note_Alternates.Item_Alt_Title)=""" & TheWord & """));")
0103 If rsNoteID.EOF Then
0104 iNoteID = 1256 'The "dud links" Note!
0105 Else
0106 rsNoteID.MoveFirst
0107 iNoteID = rsNoteID.Fields(0)
0108 End If
0109 Set rsNoteID = Nothing
0110 strLine = Left(strLine, x + 1) & iNoteID & Mid(strLine, x + 2)
0111 Y = Y + 1 + Len(iNoteID)
0112 Else
0113 iNoteID = Mid(strLine, x + 2, Y - x - 2)
0114 End If
0115 Else
0116 iNoteID = Mid(strLine, x + 2, Y - x - 2)
0117 End If
0118 'Add the Book_Note_Links link
0119 If iNoteID > 0 Then
0120 rsBookNoteLinks.AddNew
0121 rsBookNoteLinks!Book_ID1 = rsTableToRead.Fields(0)
0122 rsBookNoteLinks!Book_Author_Title = rsTableToRead.Fields(1)
0123 rsBookNoteLinks!Note_ID = iNoteID
0124 rsBookNoteLinks![Timestamp] = Now()
0125 rsBookNoteLinks.Update
0126 End If
0127 x = InStr(Y + 1, strLine, "+N")
0128 Loop
0129 rsTableToRead.MoveNext
0130Loop
0131End Sub

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



Source Code of: Regen_Note_Book_Links
Procedure Type: Public Function
Module: New Code
Lines of Code: 90
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Function Regen_Note_Book_Links(rsTableToRead As Recordset, fldNote_ID, fldNote_Text, fldNote_Timestamp)
0002Dim strControlQuery As String
0003Dim strLine As String
0004Dim rsNoteBookLinks As Recordset
0005Dim rsNoteBookLinks_Checker As Recordset
0006Dim iSection As Integer
0007Dim iFootNoteID As Integer
0008Dim x As Long
0009Dim Y As Long
0010Dim z As Long
0011Dim ID As Integer
0012Dim iTimestamp As Long
0013'Delete old links
0014 DoCmd.RunSQL ("DELETE Note_Book_Links_Temp.* FROM Note_Book_Links_Temp;")
0015If Not rsTableToRead.EOF Then
0016 rsTableToRead.MoveFirst
0017 Do Until rsTableToRead.EOF
0018 ID = rsTableToRead.Fields(fldNote_ID)
0019 iTimestamp = rsTableToRead.Fields(fldNote_Timestamp)
0020 strControlQuery = "INSERT INTO Note_Book_Links_Temp ( [Note], Note_Ref, Book, [Timestamp], Origin, Date_Created ) SELECT Note_Book_Links.Note, Note_Book_Links.Note_Ref, Note_Book_Links.Book, Note_Book_Links.Timestamp, Note_Book_Links.Origin, Note_Book_Links.Date_Created FROM Note_Book_Links WHERE (((Note_Book_Links.Note)=" & ID & ") AND ((Note_Book_Links.Timestamp)=" & iTimestamp & "));"
0021 DoCmd.RunSQL (strControlQuery)
0022 rsTableToRead.MoveNext
0023 Loop
0024 rsTableToRead.MoveFirst
0025End If
0026 strControlQuery = "DELETE Note_Book_Links.* FROM Note_Book_Links INNER JOIN Note_Book_Links_Temp ON (Note_Book_Links.Origin = Note_Book_Links_Temp.Origin) AND (Note_Book_Links.Timestamp = Note_Book_Links_Temp.Timestamp) AND (Note_Book_Links.Book = Note_Book_Links_Temp.Book) AND (Note_Book_Links.Note_Ref = Note_Book_Links_Temp.Note_Ref) AND (Note_Book_Links.Note = Note_Book_Links_Temp.Note);"
0027DoCmd.RunSQL (strControlQuery)
0028 DoCmd.RunSQL ("DELETE Note_Book_Links_Temp.* FROM Note_Book_Links_Temp;")
0029'Ready the Note_Book_Links_Temp Table
0030 strControlQuery = "SELECT Note_Book_Links_Temp.* FROM Note_Book_Links_Temp WHERE Note_Book_Links_Temp![Timestamp] = " & 99 & ";"
0031Set rsNoteBookLinks = CurrentDb.OpenRecordset(strControlQuery)
0032If Not rsTableToRead.EOF Then
0033 rsTableToRead.MoveFirst
0034 'Regenerate the Note-Book Links
0035 Do While Not rsTableToRead.EOF
0036 strLine = rsTableToRead.Fields(fldNote_Text)
0037 strLine = ReplaceCode(strLine, Chr(13) & Chr(10), "<BR>")
0038 x = 1
0039 x = InStr(x, strLine, "+B")
0040 z = 1
0041 iSection = 0
0042 If x > 0 Then
0043 z = InStr(x, strLine, "<BR>")
0044 End If
0045 Do While x > 0
0046 Y = InStr(x + 1, strLine, "B+")
0047 If Y - x > 2 Then
0048 'Need to check (a) false links and (b) for the same link in the same section
0049 If IsNumeric(Mid(strLine, x + 2, Y - x - 2)) Then
0050 If x > z Then
0051 z = InStr(z + 20, strLine, "<BR>")
0052 If z = 0 Then
0053 z = 10000000
0054 End If
0055 iSection = iSection + 1
0056 End If
0057 strControlQuery = "SELECT Note_Book_Links_Temp.Note, Note_Book_Links_Temp.Note_Ref, Note_Book_Links_Temp.Book, Note_Book_Links_Temp.Timestamp, Note_Book_Links_Temp.Origin FROM Note_Book_Links_Temp WHERE (((Note_Book_Links_Temp.Note)=" & rsTableToRead.Fields(fldNote_ID) & ") AND ((Note_Book_Links_Temp.Note_Ref)=" & iSection & ") AND ((Note_Book_Links_Temp.Book)=" & iFootNoteID & ") AND ((Note_Book_Links_Temp.Timestamp)=" & rsTableToRead.Fields(fldNote_Timestamp) & ") AND ((Note_Book_Links_Temp.Origin)=""Note""));"
0058 Set rsNoteBookLinks_Checker = CurrentDb.OpenRecordset(strControlQuery)
0059 If rsNoteBookLinks_Checker.EOF Then
0060 iFootNoteID = Mid(strLine, x + 2, Y - x - 2)
0061 rsNoteBookLinks.AddNew
0062 rsNoteBookLinks!Note = rsTableToRead.Fields(fldNote_ID)
0063 rsNoteBookLinks!Note_Ref = iSection
0064 rsNoteBookLinks!Book = iFootNoteID
0065 rsNoteBookLinks![Timestamp] = rsTableToRead.Fields(fldNote_Timestamp)
0066 rsNoteBookLinks![Origin] = "Note"
0067 rsNoteBookLinks![Date_Created] = Now()
0068 rsNoteBookLinks.Update
0069 End If
0070 Else
0071 If Y > 0 Then
0072 Y = x + 1
0073 Else
0074 Y = Len(strLine) - 1
0075 End If
0076 End If
0077 End If
0078 If Y = 0 Then
0079 Y = Len(strLine) - 1
0080 End If
0081 x = InStr(Y + 1, strLine, "+B")
0082 Loop
0083 rsTableToRead.MoveNext
0084 Loop
0085End If
0086'Copy Note_Book_Links_Temp to Note_Book_Links
0087 strControlQuery = "INSERT INTO Note_Book_Links SELECT Note_Book_Links_Temp.* FROM Note_Book_Links_Temp;"
0088DoCmd.RunSQL (strControlQuery)
0089Set rsNoteBookLinks = Nothing
0090End Function

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



Source Code of: Regen_Note_Links
Procedure Type: Public Sub
Module: New Code
Lines of Code: 154
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Sub Regen_Note_Links()
0002Dim strControlQuery As String
0003Dim strLine As String
0004Dim rsTableToRead As Recordset
0005Dim rsNotesLinks As Recordset
0006Dim rsLatestTimestamp As Recordset
0007Dim x As Long
0008Dim Y As Long
0009Dim z As Long
0010Dim z_Saved As Long
0011Dim iSuperscript As Integer
0012Dim iSection As Integer
0013Dim iFootNoteID As Integer
0014Dim strPrintNote As String
0015Dim No_FN As String
0016Dim i As Long
0017Dim TheWord As String
0018Dim rsNoteID As Recordset
0019'Read Notes records
0020 strControlQuery = "SELECT Notes_List_Auto.* FROM Notes_List_Auto ORDER BY Notes_List_Auto.ID;"
0021Set rsTableToRead = CurrentDb.OpenRecordset(strControlQuery)
0022rsTableToRead.MoveFirst
0023'Ready the Note Links
0024 DoCmd.RunSQL ("DELETE Note_Links.* FROM Note_Links;")
0025 strControlQuery = "SELECT Note_Links.* FROM Note_Links WHERE Note_Links![Timestamp] = " & Last_Changed_Timestamp & ";"
0026Set rsNotesLinks = CurrentDb.OpenRecordset(strControlQuery)
0027'Regenerate the Note Links
0028Do While Not rsTableToRead.EOF
0029 strLine = rsTableToRead.Fields(2)
0030 If rsTableToRead.Fields(11) & "" = "Temp" Then 'Find the latest archived Note, it any
0031 Set rsLatestTimestamp = CurrentDb.OpenRecordset("SELECT Notes_Archive.Item_Text, Notes_Archive.ID FROM Notes_Archive INNER JOIN Notes_Latest ON (Notes_Archive.Timestamp = Notes_Latest.Timestamp) AND (Notes_Archive.ID = Notes_Latest.ID) WHERE (((Notes_Archive.ID)=" & rsTableToRead.Fields(0) & "));")
0032 If Not rsLatestTimestamp.EOF Then
0033 rsLatestTimestamp.MoveFirst
0034 strLine = rsLatestTimestamp.Fields(0).Value
0035 End If
0036 Set rsLatestTimestamp = Nothing
0037 End If
0038 strLine = ReplaceCode(strLine, Chr(13) & Chr(10), "<BR>")
0039 x = 1
0040 z = 1
0041 iSuperscript = 1
0042 x = InStr(x, strLine, "++")
0043 iSection = 0
0044 Do While x > 0
0045 'Ignore In-sheet Footnotes
0046 No_FN = "No"
0047 Do Until No_FN = "Yes"
0048 If x > 0 Then
0049 If Mid(strLine, x + 2, 2) = "FN" Then
0050 x = x + 1
0051 x = InStr(x, strLine, "++")
0052 If x > 0 Then
0053 x = x + 1
0054 x = InStr(x, strLine, "++")
0055 iSuperscript = iSuperscript + 1
0056 End If
0057 Else
0058 No_FN = "Yes"
0059 End If
0060 Else
0061 No_FN = "Yes"
0062 End If
0063 Loop
0064 If x > 0 Then
0065 Y = InStr(x + 1, strLine, "++")
0066 If Mid(strLine, x + 2, 2) = "NP" Then
0067 If InStr(Mid(strLine, x + 4, Y - x - 4), "#") > 0 Then
0068 iFootNoteID = Left(Mid(strLine, x + 4, Y - x - 4), InStr(Mid(strLine, x + 4, Y - x - 4), "#") - 1)
0069 Else
0070 If IsNumeric(Mid(strLine, x + 4, Y - x - 4)) Then
0071 iFootNoteID = Mid(strLine, x + 4, Y - x - 4)
0072 Else
0073 iFootNoteID = 0
0074 End If
0075 End If
0076 strPrintNote = "No"
0077 Else
0078 If Y = x + 1 Then
0079 'Check this is the "++++" case where we have to look up the reference
0080 If Mid(strLine, x, 4) = "++++" Then
0081 'Find the key-word(s)
0082 If x > 1 Then
0083 If Mid(strLine, x - 1, 1) = " " Then
0084 i = FindWord(strLine, x - 1, "]")
0085 TheWord = Mid(strLine, i, x - 1 - i)
0086 Else
0087 i = FindWord(strLine, x, "]")
0088 TheWord = Mid(strLine, i, x - i)
0089 End If
0090 End If
0091 If Right(TheWord, 1) = "]" Then
0092 TheWord = Mid(TheWord, 2, Len(TheWord) - 2)
0093 End If
0094 'Find the Note ID. NB uses the Note_Alternates table!
0095 Set rsNoteID = CurrentDb.OpenRecordset("SELECT Notes.ID FROM Note_Alternates INNER JOIN Notes ON Note_Alternates.Item_Title = Notes.Item_Title WHERE (((Note_Alternates.Item_Alt_Title)=""" & TheWord & """));")
0096 If rsNoteID.EOF Then
0097 strPrintNote = "1256" 'The "dud links" Note!
0098 Else
0099 rsNoteID.MoveFirst
0100 strPrintNote = rsNoteID.Fields(0)
0101 End If
0102 Set rsNoteID = Nothing
0103 strLine = Left(strLine, x + 1) & strPrintNote & Mid(strLine, x + 2)
0104 Y = Y + 1 + Len(strPrintNote)
0105 End If
0106 Else
0107 strPrintNote = Mid(strLine, x + 2, Y - x - 2)
0108 End If
0109 If InStr(strPrintNote, "#") > 0 Then
0110 iFootNoteID = Left(strPrintNote, InStr(strPrintNote, "#") - 1)
0111 Else
0112 If IsNumeric(Mid(strLine, x + 2, Y - x - 2)) Then
0113 iFootNoteID = Mid(strLine, x + 2, Y - x - 2)
0114 Else
0115 iFootNoteID = 0
0116 End If
0117 End If
0118 strPrintNote = "Yes"
0119 End If
0120 If iFootNoteID > 0 Then
0121 rsNotesLinks.AddNew
0122 rsNotesLinks!Note_1 = rsTableToRead.Fields(0)
0123 If x > z Then
0124 Do While z < x
0125 z_Saved = z
0126 z = InStr(z + 20, strLine, "<BR>")
0127 If z = 0 Then
0128 z = 10000000
0129 End If
0130 iSection = iSection + 1
0131 Loop
0132 If z > 0 Then
0133 z = z_Saved
0134 iSection = iSection - 1
0135 End If
0136 End If
0137 rsNotesLinks!Note_1_Ref = iSection
0138 rsNotesLinks!Note_2 = iFootNoteID
0139 rsNotesLinks!Note_2_Ref = 0
0140 rsNotesLinks!Note_1_FN_ID = iSuperscript
0141 rsNotesLinks![Timestamp] = Last_Changed_Timestamp
0142 rsNotesLinks![Print_Note] = strPrintNote
0143 rsNotesLinks.Update
0144 End If
0145 x = InStr(Y + 1, strLine, "++")
0146 iSuperscript = iSuperscript + 1
0147 End If
0148 Loop
0149 rsTableToRead.MoveNext
0150Loop
0151Set rsTableToRead = Nothing
0152Set rsNotesLinks = Nothing
0153Set rsLatestTimestamp = Nothing
0154End Sub

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



Source Code of: Regen_Note_Paper_Links
Procedure Type: Public Function
Module: New Code
Lines of Code: 90
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Function Regen_Note_Paper_Links(rsTableToRead As Recordset, fldNote_ID, fldNote_Text, fldNote_Timestamp)
0002Dim strControlQuery As String
0003Dim strLine As String
0004Dim rsNotePaperLinks As Recordset
0005Dim rsNotePaperLinks_Checker As Recordset
0006Dim iSection As Integer
0007Dim iFootNoteID As Integer
0008Dim x As Long
0009Dim Y As Long
0010Dim z As Long
0011Dim ID As Integer
0012Dim iTimestamp As Long
0013'Delete old links
0014 DoCmd.RunSQL ("DELETE Note_Paper_Links_Temp.* FROM Note_Paper_Links_Temp;")
0015If Not rsTableToRead.EOF Then
0016 rsTableToRead.MoveFirst
0017 Do Until rsTableToRead.EOF
0018 ID = rsTableToRead.Fields(fldNote_ID)
0019 iTimestamp = rsTableToRead.Fields(fldNote_Timestamp)
0020 strControlQuery = "INSERT INTO Note_Paper_Links_Temp ( [Note], Note_Ref, Paper, [Timestamp], Origin, Date_Created ) SELECT Note_Paper_Links.Note, Note_Paper_Links.Note_Ref, Note_Paper_Links.Paper, Note_Paper_Links.Timestamp, Note_Paper_Links.Origin, Note_Paper_Links.Date_Created FROM Note_Paper_Links WHERE (((Note_Paper_Links.Note)=" & ID & ") AND ((Note_Paper_Links.Timestamp)=" & iTimestamp & "));"
0021 DoCmd.RunSQL (strControlQuery)
0022 rsTableToRead.MoveNext
0023 Loop
0024 rsTableToRead.MoveFirst
0025End If
0026 strControlQuery = "DELETE Note_Paper_Links.* FROM Note_Paper_Links INNER JOIN Note_Paper_Links_Temp ON (Note_Paper_Links.Origin = Note_Paper_Links_Temp.Origin) AND (Note_Paper_Links.Timestamp = Note_Paper_Links_Temp.Timestamp) AND (Note_Paper_Links.Paper = Note_Paper_Links_Temp.Paper) AND (Note_Paper_Links.Note_Ref = Note_Paper_Links_Temp.Note_Ref) AND (Note_Paper_Links.Note = Note_Paper_Links_Temp.Note);"
0027DoCmd.RunSQL (strControlQuery)
0028 DoCmd.RunSQL ("DELETE Note_Paper_Links_Temp.* FROM Note_Paper_Links_Temp;")
0029'Ready the Note_Paper_Links_Temp Table
0030 strControlQuery = "SELECT Note_Paper_Links_Temp.* FROM Note_Paper_Links_Temp WHERE Note_Paper_Links_Temp![Timestamp] = " & 99 & ";"
0031Set rsNotePaperLinks = CurrentDb.OpenRecordset(strControlQuery)
0032If Not rsTableToRead.EOF Then
0033 rsTableToRead.MoveFirst
0034 'Regenerate the Note-Paper Links
0035 Do While Not rsTableToRead.EOF
0036 strLine = rsTableToRead.Fields(fldNote_Text)
0037 strLine = ReplaceCode(strLine, Chr(13) & Chr(10), "<BR>")
0038 x = 1
0039 x = InStr(x, strLine, "+P")
0040 z = 1
0041 iSection = 0
0042 If x > 0 Then
0043 z = InStr(x, strLine, "<BR>")
0044 End If
0045 Do While x > 0
0046 Y = InStr(x + 1, strLine, "P+")
0047 If Y - x > 2 Then
0048 'Need to check (a) false links and (b) for the same link in the same section
0049 If IsNumeric(Mid(strLine, x + 2, Y - x - 2)) Then
0050 If x > z Then
0051 z = InStr(z + 15, strLine, "<BR>")
0052 If z = 0 Then
0053 z = 10000000
0054 End If
0055 iSection = iSection + 1
0056 End If
0057 strControlQuery = "SELECT Note_Paper_Links_Temp.Note, Note_Paper_Links_Temp.Note_Ref, Note_Paper_Links_Temp.Paper, Note_Paper_Links_Temp.Timestamp, Note_Paper_Links_Temp.Origin FROM Note_Paper_Links_Temp WHERE (((Note_Paper_Links_Temp.Note)=" & rsTableToRead.Fields(fldNote_ID) & ") AND ((Note_Paper_Links_Temp.Note_Ref)=" & iSection & ") AND ((Note_Paper_Links_Temp.Paper)=" & iFootNoteID & ") AND ((Note_Paper_Links_Temp.Timestamp)=" & rsTableToRead.Fields(fldNote_Timestamp) & ") AND ((Note_Paper_Links_Temp.Origin)=""Note""));"
0058 Set rsNotePaperLinks_Checker = CurrentDb.OpenRecordset(strControlQuery)
0059 If rsNotePaperLinks_Checker.EOF Then
0060 iFootNoteID = Mid(strLine, x + 2, Y - x - 2)
0061 rsNotePaperLinks.AddNew
0062 rsNotePaperLinks!Note = rsTableToRead.Fields(fldNote_ID)
0063 rsNotePaperLinks!Note_Ref = iSection
0064 rsNotePaperLinks!Paper = iFootNoteID
0065 rsNotePaperLinks![Timestamp] = rsTableToRead.Fields(fldNote_Timestamp)
0066 rsNotePaperLinks![Origin] = "Note"
0067 rsNotePaperLinks![Date_Created] = Now()
0068 rsNotePaperLinks.Update
0069 End If
0070 Else
0071 If Y > 0 Then
0072 Y = x + 1
0073 Else
0074 Y = Len(strLine) - 1
0075 End If
0076 End If
0077 End If
0078 If Y = 0 Then
0079 Y = Len(strLine) - 1
0080 End If
0081 x = InStr(Y + 1, strLine, "+P")
0082 Loop
0083 rsTableToRead.MoveNext
0084 Loop
0085End If
0086'Copy Note_Paper_Links_Temp to Note_Paper_Links
0087 strControlQuery = "INSERT INTO Note_Paper_Links SELECT Note_Paper_Links_Temp.* FROM Note_Paper_Links_Temp;"
0088DoCmd.RunSQL (strControlQuery)
0089Set rsNotePaperLinks = Nothing
0090End Function

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



© Theo Todman, June 2007 - May 2020. 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