This is what I have:
This is on a command button that references an unbound field (ARyear). Naturally when I enter 2005, it pulls up the proper form - however, when I enter 2006 I recieve an error: Run Time '2467'. However, it still opens the form if I click on 'END' on the error box.
My guess is that the code is not finished and thats why the 2005 works (because its at the end).
How do I fix this?
Code:
Private Sub GO_Click()
If [ARyear] = 2006 Then
DoCmd.OpenForm "frm2006AR", acNormal
DoCmd.Close acForm, "frmSelectYear"
Else
End If
If [ARyear] = 2005 Then
DoCmd.OpenForm "frmFilterForm", acNormal
DoCmd.Close acForm, "frmSelectYear"
Else
End If
End Sub
My guess is that the code is not finished and thats why the 2005 works (because its at the end).
How do I fix this?
Last edited: