📄 frm_dt_rk.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frm_dt_rk
BorderStyle = 1 'Fixed Single
Caption = "地图入库管理"
ClientHeight = 2475
ClientLeft = 45
ClientTop = 330
ClientWidth = 5625
Icon = "frm_dt_rk.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2475
ScaleWidth = 5625
StartUpPosition = 1 '所有者中心
Begin VB.ComboBox Combo3
Height = 300
Left = 90
Style = 2 'Dropdown List
TabIndex = 13
Top = 2025
Visible = 0 'False
Width = 1230
End
Begin VB.CommandButton Command2
Caption = "关闭(&C)"
Height = 375
Left = 4305
TabIndex = 4
Top = 2025
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确定(&E)"
Height = 375
Left = 2925
TabIndex = 3
Top = 2025
Width = 1215
End
Begin VB.Frame Frame1
Caption = "地图入库"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1860
Left = 135
TabIndex = 0
Top = 90
Width = 5385
Begin VB.ComboBox Combo1
Appearance = 0 'Flat
Height = 300
ItemData = "frm_dt_rk.frx":3452
Left = 1035
List = "frm_dt_rk.frx":3454
Style = 2 'Dropdown List
TabIndex = 12
Top = 360
Width = 4155
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 270
Index = 0
Left = 1035
MaxLength = 5
TabIndex = 8
Top = 1305
Width = 675
End
Begin VB.ComboBox Combo2
Appearance = 0 'Flat
Height = 300
Left = 1035
Locked = -1 'True
Style = 1 'Simple Combo
TabIndex = 1
Text = "Combo2"
Top = 825
Width = 1320
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 270
Index = 2
Left = 3555
Locked = -1 'True
TabIndex = 2
Top = 1305
Width = 960
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 315
Left = 3555
TabIndex = 9
Top = 795
Width = 1635
_ExtentX = 2884
_ExtentY = 556
_Version = 393216
Format = 24576000
CurrentDate = 37630
End
Begin VB.Label label1
AutoSize = -1 'True
Caption = "入库时间:"
Height = 180
Index = 2
Left = 2700
TabIndex = 11
Top = 855
Width = 810
End
Begin VB.Label label1
AutoSize = -1 'True
Caption = "入库数量:"
Height = 180
Index = 3
Left = 180
TabIndex = 10
Top = 1350
Width = 810
End
Begin VB.Label label1
AutoSize = -1 'True
Caption = "经 办 人:"
Height = 180
Index = 4
Left = 2700
TabIndex = 7
Top = 1335
Width = 810
End
Begin VB.Label label1
AutoSize = -1 'True
Caption = "地图规格:"
Height = 180
Index = 1
Left = 180
TabIndex = 6
Top = 885
Width = 810
End
Begin VB.Label label1
AutoSize = -1 'True
Caption = "地图名称:"
Height = 180
Index = 0
Left = 180
TabIndex = 5
Top = 420
Width = 810
End
End
End
Attribute VB_Name = "frm_dt_rk"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim adoPrimaryRS As Recordset
Dim adoPrimaryRS1 As Recordset
Dim adoPrimaryRS2 As Recordset
Dim db As Connection
Private Sub Combo1_Click()
Combo2.ListIndex = Combo1.ListIndex
Combo3.ListIndex = Combo1.ListIndex
End Sub
Private Sub Command1_Click()
On Error GoTo err_31:
If Val(Text1(0).Text) <> 0 Then
Set adoPrimaryRS1 = New Recordset
adoPrimaryRS1.Open "select * from s_rkjl ", db, adOpenStatic, adLockOptimistic
With adoPrimaryRS1
.AddNew
adoPrimaryRS1("地图名称") = Combo1.Text
adoPrimaryRS1("规格") = Combo2.Text
adoPrimaryRS1("入库数") = Val(Text1(0).Text)
adoPrimaryRS1("经办人") = Text1(2).Text
adoPrimaryRS1("入库时间") = DTPicker1.Value
.Update
End With
kcl = Val(Text1(0).Text)
Set adoPrimaryRS2 = New Recordset
adoPrimaryRS2.Open "select 编号,地图名称,库存数 from jb where 编号='" & Combo3.Text & "'", db, adOpenStatic, adLockOptimistic
If adoPrimaryRS2.RecordCount = 1 Then
With adoPrimaryRS2
kcl = adoPrimaryRS2("库存数") + Val(Text1(0).Text)
adoPrimaryRS2("库存数") = kcl
.Update
End With
Else
With adoPrimaryRS2
.AddNew
adoPrimaryRS2("地图名称") = Combo1.Text
adoPrimaryRS2("编号") = Combo3.Text
adoPrimaryRS2("库存数") = Val(Text1(0).Text)
.Update
End With
End If
MsgBox Combo1.Text & "库存数为" & kcl, vbExclamation
Else
MsgBox "入库数量不能为0", vbInformation, "重新输入"
End If
Exit Sub
err_31:
adoPrimaryRS1.CancelUpdate
adoPrimaryRS2.CancelUpdate
MsgBox Err.Description, vbExclamation
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error GoTo err_32:
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & fullpath("mdb\mapdata.lbl")
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select 地图名称,比例尺,地图类型,编号 from m_dt order by 编号", db, adOpenStatic, adLockOptimistic
With adoPrimaryRS
For i = 0 To .RecordCount - 1
Combo1.AddItem adoPrimaryRS("地图名称"), i
Combo2.AddItem adoPrimaryRS("比例尺") & adoPrimaryRS("地图类型"), i
Combo3.AddItem adoPrimaryRS("编号"), i
.MoveNext
Next i
Combo1.ListIndex = 0
Text1(2).Text = gz_user
End With
Exit Sub
err_32:
MsgBox Err.Description, vbExclamation
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If Index = 0 Then
strValid = "0123456789"
If KeyAscii > 26 Then
If InStr(strValid, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -