currentChanged事件、datacolchanged事件
If Forms("入库").opened Then
If Tables("入库.入库明细").Current IsNot Nothing Then
Dim pic As WinForm.PictureBox = Forms("入库").Controls("PictureBox1")
Dim wjm As String = Tables("入库.入库明细").Current("piao据原件")
If wjm.Contains(".") = False Then '若文件名不包含.,说明是未知文件
pic.Image = getimage("other.png")
Else
Dim i As Integer = wjm.LastIndexOf(".")
Dim kzm As String = wjm.SubString(i+1)
Dim kzms As String = "swf accdb mdb psd png xls xlsx bmp rar jpg doc docx zip pdf txt ppt exe" '定义已知扩展名
If kzms.Contains(kzm) = True Then
pic.image = getimage(kzm & ".png")
Else
pic.image = getimage("other.png")
End If
End If
End If
End If