Code:
Private Sub CREA_LVORARI()
Dim DA As Date, A As Date
Dim D As Date
DA = "07:00"
A = "21:30"
With Me.LVORARI
LockWindowUpdate Me.hwnd
.ColumnHeaders.Clear
.ColumnHeaders.Add , , "TAVOLO", 2000
.ColumnHeaders.Add , , "DATA", 1000, lvwColumnCenter
For D = DA To A + 0.000001 Step TimeSerial(0, 30, 0)
.ColumnHeaders.Add , , Format$(D, "HH:MM"), 600, lvwColumnCenter
Next D
For K = 0 To UBound(STRDBROWS_TAVOLI, 2)
TAVOLO = STRDBROWS_TAVOLI(2, K) & "-" & "TAVOLO-POSTI: " & STRDBROWS_TAVOLI(1, K)
Set ITMX = .ListItems.Add(, , TAVOLO)
Next K
LockWindowUpdate 0&
End With
End Sub
i call:
Private Sub Form_Initialize()
call CREA_LVORARI
End Sub
note:
STRDBROWS_TAVOLI is an array variant from getrow of recorset
Me.LVORARI is the listview
the array have only 23 element!