📄 frmout.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmOut
BackColor = &H80000001&
BorderStyle = 3 'Fixed Dialog
Caption = "出库管理"
ClientHeight = 5295
ClientLeft = 45
ClientTop = 330
ClientWidth = 8760
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5295
ScaleWidth = 8760
ShowInTaskbar = 0 'False
Begin VB.Frame Frame3
BackColor = &H80000001&
Caption = "出库单查询"
Height = 1575
Left = 240
TabIndex = 13
Top = 3000
Width = 8295
Begin VB.CommandButton Cmd_Search
Caption = "开始查询"
Height = 735
Left = 6840
TabIndex = 22
Top = 480
Width = 855
End
Begin VB.TextBox Text6
Height = 270
Left = 4320
TabIndex = 21
Top = 960
Width = 1575
End
Begin VB.TextBox Text5
Height = 270
Left = 1320
TabIndex = 20
Top = 960
Width = 1575
End
Begin VB.ComboBox Combo2
Height = 300
ItemData = "frmOut.frx":0000
Left = 4320
List = "frmOut.frx":000D
TabIndex = 19
Top = 480
Width = 1575
End
Begin VB.TextBox Text4
Appearance = 0 'Flat
Height = 270
Left = 1320
TabIndex = 18
Top = 480
Width = 1575
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "出库日期:"
Height = 255
Left = 3360
TabIndex = 17
Top = 960
Width = 1095
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "出库数量:"
Height = 255
Left = 360
TabIndex = 16
Top = 960
Width = 975
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "尺 码:"
Height = 255
Left = 3360
TabIndex = 15
Top = 480
Width = 1095
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "商品编号:"
Height = 255
Left = 360
TabIndex = 14
Top = 480
Width = 1095
End
End
Begin VB.CommandButton Cmd_Exit
Caption = "返回"
Height = 495
Left = 5400
TabIndex = 12
Top = 2400
Width = 1095
End
Begin VB.CommandButton Cmd_Update
Caption = "修改记录"
Height = 495
Left = 4320
TabIndex = 11
Top = 2400
Width = 1095
End
Begin VB.CommandButton Cmd_Del
Caption = "删除记录"
Height = 495
Left = 3240
TabIndex = 10
Top = 2400
Width = 1095
End
Begin VB.CommandButton Cmd_Addnew
Caption = "填出库单"
Height = 495
Left = 2160
TabIndex = 9
Top = 2400
Width = 1095
End
Begin MSAdodcLib.Adodc AdoOut
Height = 285
Left = 3240
Top = 1920
Width = 1935
_ExtentX = 3413
_ExtentY = 503
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 0
BackColor = -2147483647
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Password=624813;Persist Security Info=True;User ID=xt;Initial Catalog=xt;Data Source=XT"
OLEDBString = "Provider=SQLOLEDB.1;Password=624813;Persist Security Info=True;User ID=xt;Initial Catalog=xt;Data Source=XT"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "Out_Info"
Caption = "出库表"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame1
BackColor = &H80000001&
Caption = "出库单"
Enabled = 0 'False
Height = 1575
Left = 240
TabIndex = 0
Top = 240
Width = 8295
Begin VB.TextBox Text3
Appearance = 0 'Flat
DataField = "O_Date"
DataSource = "AdoOut"
Height = 270
Left = 4800
TabIndex = 8
Top = 960
Width = 1455
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
DataField = "Num"
DataSource = "AdoOut"
Height = 270
Left = 1920
TabIndex = 7
Top = 960
Width = 1455
End
Begin VB.ComboBox Combo1
Appearance = 0 'Flat
DataField = "S_Size"
DataSource = "AdoOut"
Height = 300
ItemData = "frmOut.frx":001D
Left = 4800
List = "frmOut.frx":002A
TabIndex = 6
Top = 480
Width = 1455
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
DataField = "STOR_ID"
DataSource = "AdoOut"
Height = 270
Left = 1920
TabIndex = 5
Top = 480
Width = 1455
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "出库日期:"
Height = 255
Left = 3840
TabIndex = 4
Top = 960
Width = 975
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "出库数量:"
Height = 255
Left = 840
TabIndex = 3
Top = 960
Width = 1095
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "尺 码:"
Height = 255
Left = 3840
TabIndex = 2
Top = 480
Width = 1215
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "商品编号:"
Height = 255
Left = 840
TabIndex = 1
Top = 480
Width = 975
End
End
End
Attribute VB_Name = "frmOut"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Addnew_Click()
On Error Resume Next
Frame1.Enabled = True
Cmd_Del.Enabled = False
Cmd_Update.Enabled = False
Cmd_Search.Enabled = False
If Cmd_Addnew.Caption = "填出库单" Then
Cmd_Addnew.Caption = "保存"
AdoOut.Recordset.MoveLast
AdoOut.Recordset.AddNew
Text1.SetFocus
Else
Cmd_Addnew.Caption = "填出库单"
AdoOut.Recordset.Update
AdoOut.Refresh
AdoOut.Recordset.MoveLast
Frame1.Enabled = False
Cmd_Del.Enabled = True
Cmd_Update.Enabled = True
Cmd_Search.Enabled = True
frmStor.AdoStor.Refresh
End If
End Sub
Private Sub Cmd_Del_Click()
On Error Resume Next
I = MsgBox("如果现在删除这份出库单,以后将无法恢复,你确定要删除吗?", vbOKCancel + vbQuestion, "请注意!")
If I = 1 Then
AdoOut.Recordset.Delete
AdoOut.Refresh
AdoOut.Recordset.MoveNext
If AdoOut.Recordset.EOF Then
AdoOut.Recordset.MoveLast
End If
End If
End Sub
Private Sub Cmd_Exit_Click()
Unload Form_Out
End Sub
Private Sub Cmd_Search_Click()
If AdoOut.Recordset.EOF = True Then
MsgBox "无任何记录可以查询"
Else
AdoOut.Recordset.MoveFirst
Cmd_Search.Enabled = False
Dim Stor_ID As Integer
Dim S_Size, Num, O_Date As String
Stor_ID = IIf(Trim(Text4.Text) = "", 0, Trim(Text4.Text))
S_Size = Trim(Combo2.Text)
Num = IIf(Trim(Text5.Text) = "", 0, Trim(Text5.Text))
O_Date = Trim(Text6.Text)
If Stor_ID = 0 And S_Size = "" And Num = 0 And O_Date = "" Then
MsgBox "你没有输入任何查询条件", vbOKOnly + vbCritical, "错误"
ElseIf Stor_ID = 0 And S_Size = "" And Num = 0 Then
AdoOut.Recordset.Find " O_Date='" & O_Date & "'"
ElseIf Stor_ID = 0 And S_Size = "" And O_Date = "" Then
AdoOut.Recordset.Find " Num='" & Num & "'"
ElseIf Stor_ID = 0 And O_Date = "" And Num = 0 Then
AdoOut.Recordset.Find " S_Size='" & S_Size & "'"
ElseIf S_Size = "" And Num = 0 And O_Date = "" Then
AdoOut.Recordset.Find "Stor_ID='" & Stor_ID & "'"
ElseIf Stor_ID = 0 And S_Size = "" Then
AdoOut.Recordset.Find "Num='" & Num & "' or O_Date='" & O_Date & "'"
ElseIf Stor_ID = 0 And Num = 0 Then
AdoOut.Recordset.Find "S_Size='" & S_Size & "' or O_Date='" & O_Date & "'"
ElseIf Stor_ID = 0 And O_Date = "" Then
AdoOut.Recordset.Find "S_Size='" & S_Size & "' or Num='" & Num & "'"
ElseIf S_Size = "" And Num = 0 Then
AdoOut.Recordset.Find "Stor_ID='" & Stor_ID & "' or O_Date='" & O_Date & "'"
ElseIf Num = 0 And O_Date = "" Then
AdoOut.Recordset.Find "S_Size='" & S_Size & "' or Stor_ID='" & Stor_ID & "'"
ElseIf S_Size = "" And O_Date = "" Then
AdoOut.Recordset.Find "Stor_ID='" & Stor_ID & "' or Num='" & Num & "'"
ElseIf Stor_ID = 0 Then
AdoOut.Recordset.Find "S_Size='" & S_Size & "' or Num='" & Num & "' or O_Date='" & O_Date & "'"
ElseIf S_Size = "" Then
AdoOut.Recordset.Find "Stor_ID='" & Stor_ID & "' or Num='" & Num & "' or O_Date='" & O_Date & "'"
ElseIf Num = 0 Then
AdoOut.Recordset.Find "S_Size='" & S_Size & "' or Stor_ID='" & Stor_ID & "' or O_Date='" & O_Date & "'"
ElseIf O_Date = "" Then
AdoOut.Recordset.Find "S_Size='" & S_Size & "' or Num='" & Num & "' or Stor_ID='" & Stor_ID & "'"
Else
AdoOut.Recordset.Find "S_Size='Stor_ID='" & Stor_ID & "' or " & S_Size & "' or Num='" & Num & "' or O_Date='" & O_Date & "'"
End If
If AdoOut.Recordset.EOF Then
MsgBox "没有找到此记录"
AdoOut.Recordset.MoveFirst
End If
Text4.Text = ""
Combo2.Text = ""
Text5.Text = ""
Text6.Text = ""
Cmd_Search.Enabled = True
End If
End Sub
Private Sub Cmd_Update_Click()
On Error Resume Next
Frame1.Enabled = True
Cmd_Del.Enabled = False
Cmd_Addnew.Enabled = False
Cmd_Search.Enabled = False
If Cmd_Update.Caption = "修改记录" Then
Cmd_Update.Caption = "保存"
AdoOut.Recordset.Update
Text1.SetFocus
Else
Cmd_Update.Caption = "修改记录"
AdoOut.Recordset.Update
AdoOut.Refresh
Frame1.Enabled = False
Cmd_Del.Enabled = True
Cmd_Addnew.Enabled = True
Cmd_Search.Enabled = True
End If
End Sub
Private Sub Form_Load()
If Limit = "5" Then
Form_Out.Cmd_Addnew.Enabled = False
Form_Out.Cmd_Del.Enabled = False
Form_Out.Cmd_Update.Enabled = False
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Cmd_Addnew.Caption = "保存" Or Cmd_Update.Caption = "保存" Then
I = MsgBox("数据没有存盘,要存盘吗?", vbOKCancel + vbQuestion, "请注意!")
End If
If I = 1 Then
AdoOut.Recordset.Update
Unload Me
Else
Unload Me
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -