Openform Action Cancelled RT Error '2501' (1 Viewer)

sphynx

Registered User.
Local time
Today, 16:36
Joined
Nov 21, 2007
Messages
82
I keep getting the above error in my code and don't understand why as it has been working for weeks!!!

I have a form with 3 combo boxes that I have been using as a filter for another form. This has been working fine and I don't recall changing anything within the 2 forms recently. Some advice would be greatley received.

Private Sub FILTER_Click()

Dim stDocName As String
Dim stLinkCriteria As String

1 If Me.SHIFT <> "" Then GoTo 2
GoTo 5

2 If Me.DEPARTMENT <> "" Then GoTo 3
GoTo 5

3 If Me.JOB <> "" Then GoTo 4
GoTo 5

4 If SysCmd(acSysCmdGetObjectState, acForm"TrainingDataEntry_Frm") Then
DoCmd.Close acForm, "TrainingDataEntry_Frm", acSaveYes

stDocName = "TrainingDataEntry_Frm"

stLinkCriteria = "[DEPARTMENT]=" & "'" & Me![DEPARTMENT] & "'"
stLinkCriteria = stLinkCriteria & "AND [SHIFT]=" & "'" & Me![SHIFT] & "'"
stLinkCriteria = stLinkCriteria & "AND [JOB]=" & "'" & Me![JOB] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria
GoTo 6

5 MsgBox ("Please Enter Criteria into all Boxes")
GoTo 6

6 End If

End Sub
 

RICKA

New member
Local time
Today, 16:36
Joined
Mar 23, 2005
Messages
27
Can you post the entire Error Message as this may tell you whats going wrong

Rick
 

Users who are viewing this thread

Top Bottom