Originally Posted by
ssanfu
The first thing I would change is to add these
two lines at the top of
EVERY code module:
Code:
Option Compare Database
Option Explicit
If you go to the IDE/Tools/OPTIONS, on the "Editor" tab, check the option "Require Variable Declaration". This will automatically add "Option Explicit" to
NEW modules created.
- Done
I've also added some basic error handling in each of the affected subs to start narrowing down the root cause (haven't yet had time to actually re-create the forms.)
Basically, I'm not actually resolving any errors, but I'm raising them at the point of entry so I know where they are, e.g.:
Code:
Private Sub ViewOpportunity()
On Error GoTo ViewOppErr:
Dim strLinkCriteria As String
strLinkCriteria = "[OpportunityID]=" & Me![OpportunityID]
DoCmd.OpenForm "frmOpportunityDetail", , , strLinkCriteria
Forms.frmOpportunityDetail.AllowAdditions = False
ViewOppErr:
If Err.Number <> 0 Then
MsgBox "Error in form sfrmOpportunityList in function ViewOpportunity()" & vbCrLf & Err.Description, vbCritical, "ERROR!"
Resume Next
End If
End Sub
I've got error code similar to that in every function on each form that's currently involved and once I've got this immediate problem solved, I'll go through my code and add SOME sort of error handler to every function in every module.
At this point, I'm getting an error thrown specifically in that ViewOpportunity() function, with no err.description at all, the form then opens (the resume next kicks in.)
So I've clearly still got some fine tuning to do on the error handling to determine exactly what is causing the issue.