Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub FormatListView()
Dim Item As ListItem
Dim Counter As Long
Dim FreightAmount As Currency
[color green]' Set the variable to the ListItem.[/color]
For Counter = 1 To Me.ListView1.ListItems.Count
Set Item = Me.ListView1.ListItems.Item(Counter)
[color green]' Set the variable to the Freight[/color]
FreightAmount = Item.SubItems(4)
With Me.ListView1
If FreightAmount < 100 Then
.ListItems.Item(Counter).ForeColor = 883995
.ListItems.Item(Counter).ListSubItems(1).ForeColor = 883995
.ListItems.Item(Counter).ListSubItems(2).ForeColor = 883995
.ListItems.Item(Counter).ListSubItems(3).ForeColor = 883995
.ListItems.Item(Counter).ListSubItems(4).ForeColor = 883995
Else
If FreightAmount <= 500 Or FreightAmount <= 100 Then
.ListItems.Item(Counter).ForeColor = vbBlue
.ListItems.Item(Counter).ListSubItems(1).ForeColor = vbBlue
.ListItems.Item(Counter).ListSubItems(2).ForeColor = vbBlue
.ListItems.Item(Counter).ListSubItems(3).ForeColor = vbBlue
.ListItems.Item(Counter).ListSubItems(4).ForeColor = vbBlue
Else
If FreightAmount > 500 Then
.ListItems.Item(Counter).ForeColor = vbRed
.ListItems.Item(Counter).ListSubItems(1).ForeColor = vbRed
.ListItems.Item(Counter).ListSubItems(2).ForeColor = vbRed
.ListItems.Item(Counter).ListSubItems(3).ForeColor = vbRed
.ListItems.Item(Counter).ListSubItems(4).ForeColor = vbRed
[color green] 'Make font bold[/color]
.ListItems.Item(Counter).Bold = True
.ListItems.Item(Counter).ListSubItems(1).Bold = True
.ListItems.Item(Counter).ListSubItems(2).Bold = True
.ListItems.Item(Counter).ListSubItems(3).Bold = True
.ListItems.Item(Counter).ListSubItems(4).Bold = True
End If
End If
End If
End With
Next Counter
Me.ListView1.Refresh
End Sub
Call FillOrders
Private Sub ClearFormatListView()
Dim Item As ListItem
Dim Counter As Long
Dim FreightAmount As Currency
[color green]' Set the variable to the ListItem.[/color]
For Counter = 1 To Me.ListView1.ListItems.Count
Set Item = Me.ListView1.ListItems.Item(Counter)
With Me.ListView1
[color green] ' Set them to black[/color]
.ListItems.Item(Counter).ForeColor = vbBlack
.ListItems.Item(Counter).ListSubItems(1).ForeColor = vbBlack
.ListItems.Item(Counter).ListSubItems(2).ForeColor = vbBlack
.ListItems.Item(Counter).ListSubItems(3).ForeColor = vbBlack
.ListItems.Item(Counter).ListSubItems(4).ForeColor = vbBlack
[color green]' make font normal[/color]
.ListItems.Item(Counter).Bold = False
.ListItems.Item(Counter).ListSubItems(1).Bold = False
.ListItems.Item(Counter).ListSubItems(2).Bold = False
.ListItems.Item(Counter).ListSubItems(3).Bold = False
.ListItems.Item(Counter).ListSubItems(4).Bold = False
End With
Next Counter
Me.ListView1.Refresh
End Sub