You can use a global variable (IgnoreEvent) which will function as a flag.
In sub Combo_SelectionChanged first check the value of IgnoreEvent and return if it is true.
When you update the combobox set IgnoreEvent to true at the beginning and false at the end.
[COLOR="Blue"]Private Sub[/COLOR] TableToSQLTable( Table , SQLTable )
RemoveTableIfExists( SQLTable )
SQLConnection.CreateSQLTable( Table , SQLTable )
[COLOR="blue"]End Sub[/COLOR]
[COLOR="blue"]Private Sub[/COLOR] GetFileList
FileSearch( AlFiles , DirectoryPath , "*.rtf" )
SQLConnection.BeginTransaction
For i = 0 To AlFiles.Count-1
ParsedFileName( ) = StrSplit( FileName( AlFiles.Item( i ) ) , "_" & " " )
ParsedMagNumber( ) = StrSplit( ParsedFileName( 1 ) , "#" )
For Num = 0 To 1
Magazine( Num ) = ""
If Num <= ArrayLen( ParsedMagNumber( ) )-1 Then Magazine( Num ) = ParsedMagNumber( Num )
Next
SQLCommand.CommandText = "INSERT INTO FileNames VALUES ( '" & i & "' , '" & AlFiles.Item( i ) & "' , '" & _
ParsedFileName( 0 ) & "' , '" & Magazine( 0 ) & "' , '" & Magazine( 1 ) & "' , '" & _
ParsedFileName( 2 ) & "' , '" & ParsedFileName( 3 ) & "' , '" & _
ParsedFileName( 4 ) & "' , '" & ParsedFileName( 5 ) & "' )"
SQLCommand.ExecuteNonQuery
Next
SQLConnection.EndTransaction
SQLCommand.CommandText = "SELECT Machine , Magazine0 , Magazine1 , OrderNumber , BatchNumber , Date " & _
"FROM FileNames " & _
"ORDER BY Machine"
SQLCommand.ExecuteTable( "TblFiles" , 0 )
TableToSQLTable( "TblFiles" , "FilterList" )
[COLOR="blue"]End Sub[/COLOR]
[COLOR="blue"]Private Sub[/COLOR] RefreshFileList( Index , Value )
If IgnoreEvent = False Then
StrFilter = ""
If CmbMachine.Item( CmbMachine.SelectedIndex ) <> "ALL" Then
If StrFilter = "" Then StrFilter = "WHERE "
StrFilter = StrFilter & "Machine = '" & CmbMachine.Item( CmbMachine.SelectedIndex ) & "'"
End If
If CmbMagazine.Item( CmbMagazine.SelectedIndex ) <> "ALL" Then
If StrFilter = "" Then StrFilter = "WHERE " Else StrFilter = StrFilter & " AND "
StrFilter = StrFilter & "(Magazine0 = '" & CmbMagazine.Item( CmbMagazine.SelectedIndex ) & _
"' OR Magazine1 = '" & CmbMagazine.Item( CmbMagazine.SelectedIndex ) & "')"
End If
SQLCommand.CommandText = "SELECT Machine , Magazine0 , Magazine1 , OrderNumber , BatchNumber , Date " & _
"FROM FileNames " & StrFilter & " " & _
"ORDER BY Machine"
SQLCommand.ExecuteTable( "TblFiles" , 0 )
[COLOR="Red"]TableToSQLTable( "TblFiles" , "FilterList" )[/COLOR] [COLOR="Red"]THIS LINE APPEARS TO BE DOING NOTHING!!!!!![/COLOR]
IgnoreEvent = True
UpdateOptions
End If
[COLOR="blue"]End Sub[/COLOR]
SQLCommand.CommandText = "DELETE FROM FilterList"
SQLCommand.ExecuteNonQuery
SQLCommand.CommandText = "SELECT Machine , Magazine0 , Magazine1 , OrderNumber , BatchNumber , Date " & _
"INTO FilterList " & _
"FROM FileNames " & _
StrFilter & " " & _ 'This is the WHERE parameters
"ORDER BY Machine"
[COLOR="Red"]SQLCommand.CommandText = "SELECT * FROM FilterList"[/COLOR]
SQLCommand.ExecuteTable( "TblFiles" , 0 )
SQLCommand.CommandText = "SELECT Machine , Magazine0 , Magazine1 , OrderNumber , BatchNumber , Date " & _
"INTO FilterList " & _
"FROM FileNames " & _
StrFilter & " " & _ 'This is the WHERE parameters
"ORDER BY Machine"
SQLCommand.CommandText = "INSERT INTO FilterList " & _
"Select Machine , Magazine0 , Magazine1 , OrderNumber , BatchNumber , Date " & _
"FROM Filenames " & _
StrFilter 'This is the WHERE parameters
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?