'MacroName:AF-SeriesBrowse 'MacroDescription:Use the contents of the current 4XX field to browse the authority file. ' Macro written by: Joel Hahn, Niles Public Library District ' Last modified: 25 October 2005 Sub Main Dim CS As Object Set CS = CreateObject("Connex.Client") nCurRow = CS.CursorRow bool = CS.GetFieldLine(nCurRow, sField) sSearchTerm = Mid(sField, 6) If InStr(sSearchTerm, Chr(223) & "v") Then place = InStr(sSearchTerm, Chr(223) & "v") place2 = InStr(place + 1, sSearchTerm, Chr(223)) sLT = RTrim(Left(sSearchTerm, place - 1)) If Right(sLT, 1) = ";" Then sLT = RTrim(Left(sLT, Len(sLT) - 1)) If place2 > place Then sRT = LTrim(Mid(sSearchTerm, place2)) Else sRT = "" End If sSearchTerm = sLT & " " & sRT End If If InStr(sSearchTerm, Chr(223) & "x") Then place = InStr(sSearchTerm, Chr(223) & "x") place2 = InStr(place + 1, sSearchTerm, Chr(223)) sLT = RTrim(Left(sSearchTerm, place - 1)) If Right(sLT, 1) = "," Then sLT = RTrim(Left(sLT, Len(sLT) - 1)) If place2 > place Then sRT = LTrim(Mid(sSearchTerm, place2)) Else sRT = "" End If sSearchTerm = sLT & " " & sRT End If Do While InStr(sSearchTerm, Chr(223)) place = InStr(sSearchTerm, Chr(223)) sSearchTerm = RTrim(Left(sSearchTerm, place-1)) & " " & LTrim(Mid(sSearchTerm, place + 2)) Loop If Left(sField, 3) = "440" Or Left(sField, 3) = "490" Then If CS.IsOnline = FALSE Then If CS.Logon("","","") = FALSE Then MsgBox "Unable to log on. Exiting..." Exit Sub End If End If bool = CS.Browse("AF", "ti", sSearchTerm) Else MsgBox "You have not selected a 4XX series field. Exiting..." Exit Sub End If End Sub