|
我的代码如下:
在模块中,定义了一个属性:
Type qimocondition
distribute_type As String
distribute_order As Integer
End Type
Type qimoconditions
count As Integer
items(50) As qimocondition
End Type
Dim qimoconds As qimoconditions
在一个按钮的CLICK事件中引用如下:
'点击确认按钮命令执行的程序
Private Sub cmd_qimo_generate_Click()
Dim txtnew_qimo As String
'On Error GoTo Err_cmd_qimo_generate_Click
If IsNull(Combo67.Value) Then
MsgBox "在选择期末数据匹配前,请选择所属期间!", vbOKOnly + vbExclamation, "系统提示"
Combo107.SetFocus
Exit Sub
End If
If IsNull(Combo75.Value) Then
MsgBox "在选择期末数据匹配前,请选择待匹配类型!", vbOKOnly + vbExclamation, "系统提示"
Combo75.SetFocus
Exit Sub
End If
txtnew_qimo = Combo75.Column(0)
For i = 0 To qimoconds.count
If txtnew_qimo = qimoconds.items(i).distribute_type Then
MsgBox "所选择的分配类型与前面的重复,请重新选择!", vbOKOnly + vbExclamation, "系统提示"
Combo75.SetFocus
Exit Sub
End If
Next i
With qimoconds.items(qimoconds.count)
.distribute_type = Combo75.Column(0)
.distribute_order = qimoconds.count
End With
qimoconds.count = qimoconds.count + 1
显示期末匹配顺序设置
Exit_cmd_qimo_generate_Click:
Exit Sub
Err_cmd_qimo_generate_Click:
MsgBox Err.Description
Resume Exit_cmd_qimo_generate_Click
End Sub
Private Sub 显示期末匹配顺序设置()
Dim j As Integer
List73.RowSource = "期末分配类型;分配次序;"
For j = 0 To qimoconds.count - 1
With qimoconds.items(j)
List73.RowSource = List73.RowSource & .distribute_type & ";" & .distribute_order & ";"
End With
Next j
End Sub |
|