📄 frmaddcondition.frm
字号:
VERSION 5.00
Begin VB.Form frmAddCondition
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
Caption = "Form1"
ClientHeight = 2715
ClientLeft = 0
ClientTop = 0
ClientWidth = 3840
LinkTopic = "Form1"
ScaleHeight = 2715
ScaleWidth = 3840
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Frame frabk
Appearance = 0 'Flat
BackColor = &H00E0E0E0&
ForeColor = &H80000008&
Height = 2805
Left = 0
TabIndex = 1
Top = -90
Width = 3840
Begin VB.CommandButton cmdYes
BackColor = &H80000009&
Caption = "确定"
Height = 330
Left = 855
Style = 1 'Graphical
TabIndex = 14
Top = 2385
Width = 870
End
Begin VB.CommandButton cmdNo
Appearance = 0 'Flat
BackColor = &H80000009&
Caption = "取消"
Height = 330
Left = 2070
Style = 1 'Graphical
TabIndex = 13
Top = 2385
Width = 870
End
Begin VB.TextBox txtName
Height = 285
Left = 1035
TabIndex = 0
Top = 225
Width = 2715
End
Begin VB.ComboBox cboLogicSignal
Height = 300
Left = 1035
TabIndex = 12
Text = "Combo4"
Top = 2025
Width = 2130
End
Begin VB.TextBox txtCondValue
Height = 285
Left = 1035
TabIndex = 11
Top = 1665
Width = 2670
End
Begin VB.ComboBox cboOperSignal
Height = 300
Left = 1035
TabIndex = 10
Text = "Combo3"
Top = 1305
Width = 1545
End
Begin VB.ComboBox cboFieldName
Height = 300
Left = 1035
Style = 2 'Dropdown List
TabIndex = 9
Top = 945
Width = 2715
End
Begin VB.ComboBox cboTBName
Height = 300
Left = 1035
Style = 2 'Dropdown List
TabIndex = 8
Top = 585
Width = 2715
End
Begin VB.Label lblTitle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "逻辑关系:"
Height = 180
Index = 5
Left = 90
TabIndex = 7
Top = 2115
Width = 900
End
Begin VB.Label lblTitle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "条 件 值:"
Height = 180
Index = 4
Left = 90
TabIndex = 6
Top = 1755
Width = 900
End
Begin VB.Label lblTitle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "运 算 符:"
Height = 180
Index = 3
Left = 90
TabIndex = 5
Top = 1395
Width = 900
End
Begin VB.Label lblTitle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "字 段 名:"
Height = 180
Index = 2
Left = 90
TabIndex = 4
Top = 1035
Width = 900
End
Begin VB.Label lblTitle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "数 据 表:"
Height = 180
Index = 1
Left = 90
TabIndex = 3
Top = 675
Width = 900
End
Begin VB.Label lblTitle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "条件名称:"
Height = 180
Index = 0
Left = 90
TabIndex = 2
Top = 315
Width = 900
End
End
End
Attribute VB_Name = "frmAddCondition"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private mvarStr As String
Public Property Let SetTbName(ByVal vData As String)
mvarStr = vData
End Property
Private Sub cboTBName_Click()
Dim RS As New ADODB.Recordset
cboFieldName.Clear
If Trim$(cboTBName.Text) <> "" Then
Set RS = g_TableFieldRs.Clone(adLockReadOnly)
RS.Filter = "tablename='" & cboTBName.Text & "'"
Do Until RS.EOF
cboFieldName.AddItem RS.Fields("fieldname")
RS.MoveNext
Loop
RS.Close
Set RS = Nothing
End If
End Sub
Private Sub cmdNo_Click()
Unload Me
End Sub
Private Sub cmdYes_Click()
Dim i As Integer
If Trim$(txtName.Text) = "" Then
MsgBox "条件名称为空。", vbCritical + vbOKOnly, "错误提示"
txtName.SetFocus
Exit Sub
End If
If g_WFType = 2 Then
If Trim$(cboTBName.Text) = "" Then
MsgBox "应用表名称为空。", vbCritical + vbOKOnly, "错误提示"
cboTBName.SetFocus
Exit Sub
End If
End If
If Trim$(cboFieldName.Text) = "" Then
MsgBox "字段为空。", vbCritical + vbOKOnly, "错误提示"
cboFieldName.SetFocus
Exit Sub
End If
If Trim$(cboOperSignal.Text) = "" Then
MsgBox "运算符为空。", vbCritical + vbOKOnly, "错误提示"
cboOperSignal.SetFocus
Exit Sub
End If
If Trim$(txtCondValue.Text) = "" Then
MsgBox "条件值为空。", vbCritical + vbOKOnly, "错误提示"
txtCondValue.SetFocus
Exit Sub
End If
With frmActive
If .mfgCondition.Rows > 1 Then
If Trim$(cboLogicSignal.Text) = "" Then
MsgBox "逻辑关系符为空。", vbCritical + vbOKOnly, "错误提示"
cboLogicSignal.SetFocus
Exit Sub
End If
End If
End With
With frmActive.mfgCondition
i = .Rows
.Rows = i + 1
.TextMatrix(i, 0) = i
.TextMatrix(i, 1) = Trim(txtName.Text)
.TextMatrix(i, 2) = Trim(cboTBName.Text)
.TextMatrix(i, 3) = Trim(cboFieldName.Text)
.TextMatrix(i, 4) = Trim(cboOperSignal.Text)
.TextMatrix(i, 5) = Trim(txtCondValue.Text)
.TextMatrix(i, 6) = Trim(cboLogicSignal.Text)
End With
Unload Me
End Sub
Private Sub Form_Load()
Dim tmpStr() As String
Dim i, count As Integer
Dim RS As New ADODB.Recordset
With cboOperSignal
.AddItem "="
.AddItem ">"
.AddItem "<"
.AddItem ">="
.AddItem "<="
.AddItem "<>"
.AddItem "like"
.AddItem "not like"
.AddItem "in"
.AddItem "not in"
.Text = ""
End With
With cboLogicSignal
.AddItem "Or"
.AddItem "and"
.Text = ""
If frmActive.mfgCondition.Rows = 1 Then
.Enabled = False
End If
End With
If g_WFType = 1 Then
cboTBName.BackColor = &HE0E0E0
cboTBName.Enabled = False
Set RS = g_TableFieldRs.Clone(adLockReadOnly)
Do Until RS.EOF
cboFieldName.AddItem RS.Fields("FieldName")
RS.MoveNext
Loop
ElseIf g_WFType = 0 Then
cboTBName.BackColor = &HE0E0E0
cboTBName.Enabled = False
Else
tmpStr = Split(mvarStr, ",")
count = UBound(tmpStr)
For i = 0 To count
cboTBName.AddItem tmpStr(i)
Next i
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -