Hi
I'm hoping someone can help me with this. I'm doing some additions to a database at work that someone else made, and it's mostly going well.
What I'm stuck with is code to get one of three forms to open depending on the field values in two other fields.
Here's the code I have so far:
I keep getting a 424 Run_time error code.
My guess is that having two conditions in the If and ElseIf statements is what's making it crash.
I'm still fairly new at VBA, self-taught so have probably got it completely wrong. Any help would be greatly appreciated.

I'm hoping someone can help me with this. I'm doing some additions to a database at work that someone else made, and it's mostly going well.
What I'm stuck with is code to get one of three forms to open depending on the field values in two other fields.
Here's the code I have so far:
Private Sub cmdEdit_Click()
Dim stDocName As String
Dim strFilter As String
Dim stLinkCriteria As String
If Preventative_Reqd = False And Assigned_Evaluator Is Null Then
stDocName = "frm_Results"
strFilter = "Number= '" & Me.Number & "'"
stLinkCriteria = "frm_CIF_To_Be_ActionedEvaluation"
DoCmd.OpenForm stDocName, acNormal, , strFilter, , , stLinkCriteria
ElseIf Preventative_Reqd = True And Assigned_Evaluator Is Null Then
stDocName = "frm_ResultsPreventative"
strFilter = "Number= '" & Me.Number & "'"
stLinkCriteria = "frm_CIF_To_Be_ActionedEvaluation"
DoCmd.OpenForm stDocName, acNormal, , strFilter, , , stLinkCriteria
ElseIf Preventative_Reqd = False And Assigned_Evaluator Is Not Null Then
stDocName = "frm_ResultsEvaluator"
strFilter = "Number= '" & Me.Number & "'"
stLinkCriteria = "frm_CIF_To_Be_ActionedEvaluation"
DoCmd.OpenForm stDocName, acNormal, , strFilter, , , stLinkCriteria
ElseIf Preventative_Reqd = True And Assigned_Evaluator Is Not Null Then
stDocName = "frm_ResultsEvaluator"
strFilter = "Number= '" & Me.Number & "'"
stLinkCriteria = "frm_CIF_To_Be_ActionedEvaluation"
DoCmd.OpenForm stDocName, acNormal, , strFilter, , , stLinkCriteria
End If
End Sub
I keep getting a 424 Run_time error code.
My guess is that having two conditions in the If and ElseIf statements is what's making it crash.
I'm still fairly new at VBA, self-taught so have probably got it completely wrong. Any help would be greatly appreciated.
