Private
Sub
lstAudits_Click()
Dim
tmp, i&, zWerk
As
Variant
With
lstAudits
TxtAuditID = .List(.ListIndex, 1)
cboStatus = .List(.ListIndex, 2)
cboWerk = .List(.ListIndex, 3)
cboAuditType = .List(.ListIndex, 4)
txtLeadAuditor = .List(.ListIndex, 6)
txtCoAuditor = .List(.ListIndex, 7)
txtPersonDays = .List(.ListIndex, 8)
txtShift = .List(.ListIndex, 9)
txtCustomer = .List(.ListIndex, 10)
txtResponsible = .List(.ListIndex, 11)
tmp = .List(.ListIndex, 5)
For
i = 0
To
UBound(arrChk)
If
InStr(1, tmp, Right(arrChk(i), 5), vbTextCompare) > 0
Then
Controls(arrChk(i)) =
True
Else
Controls(arrChk(i)) =
False
End
If
Next
i
If
TxtAuditID =
""
Then
zWerk = Application.Match(.List(.ListIndex, 3), Tabelle0.Range(
"Tabelle2[Werkname]"
), 0)
If
Not
IsError(zWerk)
Then
TxtAuditID = Tabelle0.ListObjects(1).DataBodyRange.Cells(zWerk, 1) &
"-"
& Format(Tabelle0.ListObjects(1).DataBodyRange.Cells(zWerk, 4) + 1,
"00"
)
End
If
End
If
End
With
End
Sub