Can anyone help?
I have problem with date filetr. My general idea is to let the team to put their input, chose the input type, their action and the code do the rest. So far, displaying the items.
My problem is by Date field entries. It shows nothing. I checked tha site and found I should use long data type, but it shows more and more errors.
If any idea instead of using goto, I will appreciated. I want to use it for coding for different actions.
Warmly yours,
M
I have problem with date filetr. My general idea is to let the team to put their input, chose the input type, their action and the code do the rest. So far, displaying the items.
My problem is by Date field entries. It shows nothing. I checked tha site and found I should use long data type, but it shows more and more errors.
If any idea instead of using goto, I will appreciated. I want to use it for coding for different actions.
Warmly yours,
M
Code:
Private Sub Go_Click()
'
Dim I As String ' specifies the input
Dim f As Integer ' for choosing the field
Dim a As String ' for choosing the action
Dim d As Long ' for date input
Dim t As String ' specifies the input type
Dim C As ListObject 'for clearing Filters
t = ActiveSheet.Range("e3").Value
I = ActiveSheet.Range("g3").Value
a = ActiveSheet.Range("f3").Value
If I = "0" Then
Sheets("FTV4_Materials").Range("tbl").AutoFilter
Else
If a = "" Then
GoTo V
Else
Select Case a
Case "View Materials"
GoTo V
Case "close"
GoTo C
Case "issue KIT"
GoTo I
Case "receive"
GoTo R
Case "issue Items"
GoTo II
End Select
End If
GoTo finalline
C:
Sheets("Dash").Range("a1") = "No Data Close"
GoTo finalline
R:
Sheets("Dash").Range("a1") = "No Data Receive"
GoTo finalline
I:
Sheets("Dash").Range("a1") = "No Data Issue KIT"
GoTo finalline
II:
Sheets("Dash").Range("a1") = "No Data Issue Items"
GoTo finalline
V:
Select Case t
Case "W/B"
f = 3
Case "P/#"
f = 4
Case "O/#"
f = 3
Case "Receiving Date"
Sheets("FTV4_Materials").Range("tbl").AutoFilter
rcvddate = CLng(DateValue(I))
Sheets("FTV4_Materials").Range("tbl").AutoFilter Field:=12, Criteria1:=rcvddate, Operator:=xlFilterValues
Sheets("FTV4_Materials").Select
ActiveSheet.Range("tbl[[#Headers],[ID]]").Select
GoTo finalline
Case "R/N"
f = 13
Case "Descriptio"
f = 6
End Select
Sheets("FTV4_Materials").Range("tbl").AutoFilter
Sheets("FTV4_Materials").Range("tbl").AutoFilter Field:=f, Criteria1:="=*" & I & "*", Operator:=xlAnd
Sheets("FTV4_Materials").Select
ActiveSheet.Range("tbl[[#Headers],[ID]]").Select
finalline:
End If
End Sub