A
Angela
I am just beginning VBA coding and have fell into having
to repair someone else's code in a critical database and
must get it repaired ASAP!
Here is the original code that seems to be causing the
problem:
Option Explicit
Function openNextFormCloseCurrent(FormNameToOpen As
String, curForm As String)
Dim stLinkCriteria As String
Dim frmCurrentForm As String
Dim stDoc1 As String
frmCurrentForm = curForm
stDoc1 = FormNameToOpen
DoCmd.OpenForm stDoc1, , , stLinkCriteria
DoCmd.Close acForm, frmCurrentForm
End Function
Function FilterNextFormCloseCurrent(FormNameToOpen As
String, curForm As String, intID As Integer)
Dim stLinkCriteria As String
Dim stDoc1 As String
Dim frmCurrentForm As String
Dim intProjCriteria As Integer
intProjCriteria = intID
frmCurrentForm = curForm
stDoc1 = FormNameToOpen
stLinkCriteria = "[ImprovProjMainTblID]=" &
intProjCriteria
DoCmd.OpenForm stDoc1, , , stLinkCriteria
DoCmd.Close acForm, frmCurrentForm
End Function
I have added exit statements and error handling but after
almost a week without the error it has recurred. I can
not open the forms in any view. I was told the person
who wrote the code "fixed" the problem by deleting the
forms and re-importing them from a backup.
Your help is greatly appreciated!
to repair someone else's code in a critical database and
must get it repaired ASAP!
Here is the original code that seems to be causing the
problem:
Option Explicit
Function openNextFormCloseCurrent(FormNameToOpen As
String, curForm As String)
Dim stLinkCriteria As String
Dim frmCurrentForm As String
Dim stDoc1 As String
frmCurrentForm = curForm
stDoc1 = FormNameToOpen
DoCmd.OpenForm stDoc1, , , stLinkCriteria
DoCmd.Close acForm, frmCurrentForm
End Function
Function FilterNextFormCloseCurrent(FormNameToOpen As
String, curForm As String, intID As Integer)
Dim stLinkCriteria As String
Dim stDoc1 As String
Dim frmCurrentForm As String
Dim intProjCriteria As Integer
intProjCriteria = intID
frmCurrentForm = curForm
stDoc1 = FormNameToOpen
stLinkCriteria = "[ImprovProjMainTblID]=" &
intProjCriteria
DoCmd.OpenForm stDoc1, , , stLinkCriteria
DoCmd.Close acForm, frmCurrentForm
End Function
I have added exit statements and error handling but after
almost a week without the error it has recurred. I can
not open the forms in any view. I was told the person
who wrote the code "fixed" the problem by deleting the
forms and re-importing them from a backup.
Your help is greatly appreciated!