M
mike waters
Hello,
a few weeks back I posted a message asking for help
when trying to filter a form with VB. I was given a
suggestion, and tried it, but for some reason I keep
getting an error message. It says run time error 2001:
You canceled the previous operation. Below is the exact
code how I have it:
Private Sub Form_Open(Cancel As Integer)
Dim RetVal As String
If More_Locations.Value = True Then
FormFooter.Visible = True
Else
FormFooter.Visible = False
End If
RetVal = InputBox("Enter PO")
If RetVal = "" Then
Me.FilterOn = False
ElseIf IsNumeric(RetVal) Then
Me.Filter = "[PO#]=" & RetVal
Me.FilterOn = True 'This is the line its stopping
on
Else
MsgBox "Invalid Entry"
End If
End Sub
I've treid everything I can think of. I've tried putting
a button on my form to filter using the code here, and I
get the same error message. I only get the messaage when
I enter a valid number. It works fine if I enter an
invalid selection. If anyone has any suggestion please
let me know.
Thank You,
Mike Waters
a few weeks back I posted a message asking for help
when trying to filter a form with VB. I was given a
suggestion, and tried it, but for some reason I keep
getting an error message. It says run time error 2001:
You canceled the previous operation. Below is the exact
code how I have it:
Private Sub Form_Open(Cancel As Integer)
Dim RetVal As String
If More_Locations.Value = True Then
FormFooter.Visible = True
Else
FormFooter.Visible = False
End If
RetVal = InputBox("Enter PO")
If RetVal = "" Then
Me.FilterOn = False
ElseIf IsNumeric(RetVal) Then
Me.Filter = "[PO#]=" & RetVal
Me.FilterOn = True 'This is the line its stopping
on
Else
MsgBox "Invalid Entry"
End If
End Sub
I've treid everything I can think of. I've tried putting
a button on my form to filter using the code here, and I
get the same error message. I only get the messaage when
I enter a valid number. It works fine if I enter an
invalid selection. If anyone has any suggestion please
let me know.
Thank You,
Mike Waters