Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community

Upgraded Access to Office 365 - How do I get

Copper Contributor

I upgraded Access to Office 365, now my modules - VB Functions don't work.  How can I get them to work?

 

Public Function fix_name(zname As String) As String
' strip comma 1st
Dim ipos As Long
Dim lname As String
Dim fname As String
ipos = InStr(zname, ",")
If ipos > 0 Then
zname = Replace(zname, ",", "")
End If
ipos = InStr(zname, " ")
If ipos > 0 Then
lname = Left(zname, ipos - 1)
fname = Mid(zname, ipos, Len(zname) - (ipos - 1))
fix_name = StrConv(fname & " " & lname, 3)
Else
fix_name = StrConv(zname, 3)
End If
End Function

Public Function fix_year(Assess As String) As String
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim hold_year As String
Set db = CurrentDb
Set rst = db.OpenRecordset("Select [Taxyear] as tyear from [Roll_MultiJuri_Delq_MultYrs_02-09-2009_V1] where [cadno]='" & Assess & "' order by [taxyear]")
If rst.EOF = True Then
fix_year = ""
Else
rst.MoveFirst
hold_year = ""
Do While rst.EOF = False
hold_year = hold_year & rst!tYear & ", "
rst.MoveNext
Loop
fix_year = Left(hold_year, Len(hold_year) - 2)
End If
rst.Close
Set rst = Nothing
Set db = Nothing
End Function
Public Function fix_year2(Assess As String) As String
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim hold_year As String
Set db = CurrentDb
Set rst = db.OpenRecordset("Select [year] as tyear from [Leared] where [Acct#]='" & Assess & "' order by [year]")
If rst.EOF = True Then
fix_year2 = ""
Else
rst.MoveFirst
hold_year = ""
Do While rst.EOF = False
hold_year = hold_year & rst!tYear & ", "
rst.MoveNext
Loop
fix_year2 = Left(hold_year, Len(hold_year) - 2)
End If
rst.Close
Set rst = Nothing
Set db = Nothing
End Function
Public Function fix_year3(Assess As String) As String
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim hold_year As String
Set db = CurrentDb
Set rst = db.OpenRecordset("Select [taxyear] as tyear from [Joann] where [CadNo]='" & Assess & "' order by [taxyear]")
If rst.EOF = True Then
fix_year3 = ""
Else
rst.MoveFirst
hold_year = ""
Do While rst.EOF = False
hold_year = hold_year & rst!tYear & ", "
rst.MoveNext
Loop
fix_year3 = Left(hold_year, Len(hold_year) - 2)
End If
rst.Close
Set rst = Nothing
Set db = Nothing
End Function
Public Function fix_year4(Assess As String) As String
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim hold_year As String
Set db = CurrentDb
'MsgBox Assess
Set rst = db.OpenRecordset("Select [year] as tyear from [JUNE MUTH - SMM & C1] where [TAXACCTNO] ='" & Assess & "' order by [Year]")
If rst.EOF = True Then
fix_year4 = ""
Else
rst.MoveFirst
hold_year = ""
Do While rst.EOF = False
hold_year = hold_year & rst!tYear & ", "
rst.MoveNext
Loop
fix_year4 = Left(hold_year, Len(hold_year) - 2)
End If
rst.Close
Set rst = Nothing
Set db = Nothing
End Function
Public Function fix_year5(Assess As String) As String
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim hold_year As String
Set db = CurrentDb
Set rst = db.OpenRecordset("Select [Year]as tyear from [Comma3-9-09b] where [tax assessor#]='" & Assess & "' order by [Year]")
If rst.EOF = True Then
fix_year5 = ""
Else
rst.MoveFirst
hold_year = ""
Do While rst.EOF = False
hold_year = hold_year & rst!tYear & ", "
rst.MoveNext
Loop
fix_year5 = Left(hold_year, Len(hold_year) - 2)
End If
rst.Close
Set rst = Nothing
Set db = Nothing
End Function

 

0 Replies