📄 frmclientinformation.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmClientInformation
BorderStyle = 3 'Fixed Dialog
Caption = "客户提供相关资料"
ClientHeight = 5955
ClientLeft = 1725
ClientTop = 1185
ClientWidth = 8895
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5955
ScaleWidth = 8895
ShowInTaskbar = 0 'False
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 360
Left = 2655
MaxLength = 50
TabIndex = 2
Top = 135
Width = 5070
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1740
Style = 2 'Dropdown List
TabIndex = 1
Top = 165
Width = 840
End
Begin VB.ComboBox Combo2
Height = 300
Left = 120
Style = 2 'Dropdown List
TabIndex = 0
Top = 165
Width = 1530
End
Begin VB.CommandButton Sure
Caption = "查找"
Height = 390
Left = 7875
TabIndex = 3
Top = 120
Width = 840
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 3495
Left = 120
TabIndex = 4
Top = 600
Width = 8655
_ExtentX = 15266
_ExtentY = 6165
_Version = 393216
AllowUserResizing= 1
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "须退还资料"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 8
Top = 4200
Width = 9015
End
Begin VB.Label Label2
Caption = "0"
ForeColor = &H000000FF&
Height = 255
Left = 120
TabIndex = 7
Top = 4680
Width = 8655
WordWrap = -1 'True
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "0"
ForeColor = &H000000FF&
Height = 180
Left = 120
TabIndex = 6
Top = 5640
Width = 8655
WordWrap = -1 'True
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "可保留资料"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 5
Top = 5160
Width = 8655
End
End
Attribute VB_Name = "frmClientInformation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim TempStr, TempString As String
Dim rs As Recordset
Private Sub Form_Load()
Dim i, j As Integer
MSFlexGrid1.Cols = 6
MSFlexGrid1.Row = 0
MSFlexGrid1.Col = 0
MSFlexGrid1.Text = "序号"
MSFlexGrid1.ColWidth(0) = 600
MSFlexGrid1.Col = 1
MSFlexGrid1.Text = "生产单号"
MSFlexGrid1.ColWidth(1) = 1000
MSFlexGrid1.Col = 2
MSFlexGrid1.Text = "客户编号"
MSFlexGrid1.ColWidth(2) = 1000
MSFlexGrid1.Col = 3
MSFlexGrid1.Text = "定单类型"
MSFlexGrid1.ColWidth(3) = 1000
MSFlexGrid1.Col = 4
MSFlexGrid1.Text = "须退还资料"
MSFlexGrid1.ColWidth(4) = 4500
MSFlexGrid1.Col = 5
MSFlexGrid1.Text = "可保留资料"
MSFlexGrid1.ColWidth(5) = 4500
Combo1.AddItem "等于", 0
Combo1.AddItem "包含", 1
Combo1.ListIndex = 1
'FindOk = False
Combo2.AddItem "生产单号", 0
Combo2.AddItem "客户编号", 1
Combo2.AddItem "定单类型", 2
Combo2.ListIndex = 0
Me.Icon = frmain.Icon
TempStr = "select dinno,clino,type,client_res,client_own from din where return_flag=0 and din_date>='" & Date - 30 & "'order by din_date desc"
Set rs = New Recordset
rs.Open TempStr, db
On Error Resume Next
rs.MoveFirst
If rs.RecordCount <> 0 Then
i = 1
Do Until rs.EOF
MSFlexGrid1.Rows = i + 1
MSFlexGrid1.Row = i
MSFlexGrid1.Col = 0
MSFlexGrid1.Text = i
For j = 1 To 6
MSFlexGrid1.Col = j
MSFlexGrid1.Text = rs(j - 1)
Next
rs.MoveNext
i = i + 1
Loop
rs.Close
Set rs = Nothing
End If
Label2 = ""
Label4 = ""
End Sub
Private Sub Form_Resize()
On Error Resume Next
Me.Top = 0
Me.Left = 50
End Sub
Private Sub MSFlexGrid1_Click()
Dim i, j As Integer
Dim sqlstr As String
MSFlexGrid1.Col = 1
If MSFlexGrid1.Text = "" Then Exit Sub
sqlstr = "select client_res,client_own from din where dinno='" & MSFlexGrid1.Text & "'"
Set rs = New Recordset
rs.Open sqlstr, db
On Error Resume Next
rs.MoveFirst
If rs.BOF And rs.EOF Then
Label2 = ""
Label4 = ""
MsgBox "对不起,没有找到生产单明细!", , "提示"
rs.Close
Exit Sub
End If
i = 1
Do Until rs.EOF
If IsNull(rs.Fields(0)) Then Label2 = "" Else Label2 = rs.Fields(0)
If IsNull(rs.Fields(1)) Then Label4 = "" Else Label4 = rs.Fields(1)
rs.MoveNext
i = i + 1
Loop
rs.Close
Set rs = Nothing
End Sub
Private Sub MSFlexGrid1_SelChange()
Dim i, j As Integer
Dim sqlstr As String
MSFlexGrid1.Col = 1
If MSFlexGrid1.Text = "" Then Exit Sub
sqlstr = "select client_res,client_own from din where dinno='" & MSFlexGrid1.Text & "'"
Set rs = New Recordset
rs.Open sqlstr, db
On Error Resume Next
rs.MoveFirst
If rs.BOF And rs.EOF Then
Label2 = ""
Label4 = ""
MsgBox "对不起,没有找到生产单明细!", , "提示"
rs.Close
Exit Sub
End If
i = 1
Do Until rs.EOF
If IsNull(rs.Fields(0)) Then Label2 = "" Else Label2 = rs.Fields(0)
If IsNull(rs.Fields(1)) Then Label4 = "" Else Label4 = rs.Fields(1)
rs.MoveNext
i = i + 1
Loop
rs.Close
Set rs = Nothing
End Sub
Private Sub Sure_Click()
If Trim(Text1.Text) = "" Then
TempStr = "select dinno,clino,type,client_res,client_own from din where return_flag=0 and din_date>='" & Date - 30 & "'order by din_date desc"
Else
Select Case Combo1.Text
Case "等于"
Select Case Combo2.Text
Case "生产单号"
TempStr = "select dinno,clino,type,client_res,client_own from din where dinno='" & Trim(Text1.Text) & "'"
Case "客户编号"
TempStr = "select dinno,clino,type,client_res,client_own from din where clino='" & Trim(Text1.Text) & "'"
Case "定单类型"
TempStr = "select dinno,clino,type,client_res,client_own from din where type='" & Trim(Text1.Text) & "'"
End Select
Case "包含"
Select Case Combo2.Text
Case "退还否(0/1)"
TempStr = "select dinno,clino,type,client_res,client_own from din where return_flag Like '%" & Trim(Text1.Text) & "%'"
Case "生产单号"
TempStr = "select dinno,clino,type,client_res,client_own from din where dinno Like '%" & Trim(Text1.Text) & "%'"
Case "客户编号"
TempStr = "select dinno,clino,type,client_res,client_own from din where clino Like '%" & Trim(Text1.Text) & "%'"
Case "定单类型"
TempStr = "select dinno,clino,type,client_res,client_own from din where type Like '%" & Trim(Text1.Text) & "%'"
End Select
End Select
End If
Set rs = New Recordset
rs.Open TempStr, db
On Error Resume Next
rs.MoveFirst
If rs.BOF And rs.EOF Then
Label2 = ""
Label4 = ""
MSFlexGrid1.Rows = 1
MsgBox "对不起,没有找到您需要的记录!", , "提示"
rs.Close
Exit Sub
End If
i = 1
Do Until rs.EOF
MSFlexGrid1.Rows = i + 1
MSFlexGrid1.Row = i
MSFlexGrid1.Col = 0
MSFlexGrid1.Text = i
For j = 1 To 6
MSFlexGrid1.Col = j
MSFlexGrid1.Text = rs(j - 1)
Next
rs.MoveNext
i = i + 1
Loop
rs.Close
Set rs = Nothing
End Sub
Private Sub Text1_Change()
'If Trim(Text1.Text) = "" Then
'Sure.Enabled = False
'Else
'Sure.Enabled = True
'End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Sure.Enabled = True Then Sure.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -