?? 各部錄入.frm
字號(hào):
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 4789
Picture = "各部錄入.frx":3FA6
EndProperty
BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Alignment = 2
AutoSize = 1
Object.Width = 6553
MinWidth = 4304
Picture = "各部錄入.frx":43FA
EndProperty
BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Alignment = 2
AutoSize = 1
Object.Width = 4789
Picture = "各部錄入.frx":484E
EndProperty
EndProperty
End
Begin MSComctlLib.StatusBar StatusBar1
Height = 345
Index = 6
Left = -74970
TabIndex = 7
Top = 6150
Width = 11955
_ExtentX = 21087
_ExtentY = 609
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 4
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 4789
Picture = "各部錄入.frx":4CA2
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 4789
Picture = "各部錄入.frx":4DFE
EndProperty
BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Alignment = 2
AutoSize = 1
Object.Width = 6553
MinWidth = 4304
Picture = "各部錄入.frx":5252
EndProperty
BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Alignment = 2
AutoSize = 1
Object.Width = 4789
Picture = "各部錄入.frx":56A6
EndProperty
EndProperty
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "各部錄入.frx":5AFA
Height = 4815
Index = 1
Left = 180
OleObjectBlob = "各部錄入.frx":5B0E
TabIndex = 8
Top = 585
Width = 11655
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "各部錄入.frx":7068
Height = 4815
Index = 2
Left = -74820
OleObjectBlob = "各部錄入.frx":707C
TabIndex = 9
Top = 585
Width = 11655
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "各部錄入.frx":85D6
Height = 4815
Index = 3
Left = -74820
OleObjectBlob = "各部錄入.frx":85EA
TabIndex = 10
Top = 585
Width = 11655
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "各部錄入.frx":9B44
Height = 4815
Index = 4
Left = -74820
OleObjectBlob = "各部錄入.frx":9B58
TabIndex = 11
Top = 585
Width = 11655
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "各部錄入.frx":B0B2
Height = 4815
Index = 5
Left = -74820
OleObjectBlob = "各部錄入.frx":B0C6
TabIndex = 12
Top = 585
Width = 11655
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "各部錄入.frx":C624
Height = 4815
Index = 6
Left = -74820
OleObjectBlob = "各部錄入.frx":C638
TabIndex = 13
Top = 585
Width = 11655
End
End
Begin VB.Shape Shape1
BorderColor = &H00C0FFFF&
BorderWidth = 2
FillColor = &H00000040&
Height = 615
Left = 2970
Shape = 4 'Rounded Rectangle
Top = 210
Width = 6225
End
Begin VB.Line Line1
BorderColor = &H80000005&
BorderWidth = 3
X1 = 1.997
X2 = 808.984
Y1 = 64.873
Y2 = 64.873
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "各 部 錄 入"
BeginProperty Font
Name = "隸書"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 525
Left = 3660
TabIndex = 0
Top = 240
Width = 4785
End
End
Attribute VB_Name = "各部錄入"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Num(1 To 6) As Integer, I As Integer
Private Sub Form_Load()
On Error GoTo X1
Me.Left = 0: Me.Top = 0
Data1.DatabaseName = App.Path + "\" + "db1.mdb"
Data1.RecordSource = "糖茶飲料部"
Data1.Refresh
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
Num(1) = Data1.Recordset.RecordCount
StatusBar1(1).Panels(1).Text = "記錄總數(shù): " & Num(1)
StatusBar1(1).Panels(2).Text = "當(dāng)前記錄: " & 1
StatusBar1(1).Panels(3).Text = "今天日期: " & Format(Date, "yyyy 年 m 月 d 日")
StatusBar1(1).Panels(4).Text = "當(dāng)前時(shí)間: " & Time
I = 1
Exit Sub
X1:
Data1.Recordset.AddNew
StatusBar1(1).Panels(1).Text = "記錄總數(shù): " & 1
StatusBar1(1).Panels(2).Text = "當(dāng)前記錄: " & 1
StatusBar1(1).Panels(3).Text = "今天日期: " & Format(Date, "yyyy 年 m 月 d 日")
StatusBar1(1).Panels(4).Text = "當(dāng)前時(shí)間: " & Time
I = 1
End Sub
Private Sub Command1_Click(Index As Integer)
On Error Resume Next
Data1.Recordset.MoveFirst
End Sub
Private Sub Command2_Click(Index As Integer)
On Error Resume Next
Data1.Recordset.MovePrevious
If Data1.Recordset.AbsolutePosition < 0 Then
Data1.Recordset.MoveFirst
StatusBar1(I).Panels(2).Text = "當(dāng)前記錄: " & Data1.Recordset.AbsolutePosition + 1
MsgBox "已經(jīng)是第一條記錄 ! ", vbExclamation
Else
StatusBar1(I).Panels(2).Text = "當(dāng)前記錄: " & Data1.Recordset.AbsolutePosition + 1
End If
End Sub
Private Sub Command3_Click(Index As Integer)
On Error Resume Next
Data1.Recordset.MoveNext
If Data1.Recordset.AbsolutePosition + 1 = 0 Then
Data1.Recordset.MoveLast
StatusBar1(I).Panels(2).Text = "當(dāng)前記錄: " & Num(I)
MsgBox "已經(jīng)是最后一條記錄 ! ", vbExclamation
Else
StatusBar1(I).Panels(2).Text = "當(dāng)前記錄: " & Data1.Recordset.AbsolutePosition + 1
End If
End Sub
Private Sub Command4_Click(Index As Integer)
On Error Resume Next
Data1.Recordset.MoveLast
StatusBar1(I).Panels(2).Text = "當(dāng)前記錄: " & Num(I)
End Sub
Private Sub Command5_Click(Index As Integer)
Unload Me
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
On Error GoTo X1
Select Case SSTab1.Caption
Case "糖茶飲料部"
Data1.RecordSource = "糖茶飲料部": I = 1
Case "文教用品部"
Data1.RecordSource = "文教用品部": I = 2
Case "家用電器部"
Data1.RecordSource = "家用電器部": I = 3
Case " 服裝部 "
Data1.RecordSource = "服裝部": I = 4
Case " 鞋帽部 "
Data1.RecordSource = "鞋帽部": I = 5
Case " 食品部 "
Data1.RecordSource = "食品部": I = 6
End Select
Data1.Refresh
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
Num(I) = Data1.Recordset.RecordCount
StatusBar1(I).Panels(1).Text = "記錄總數(shù): " & Num(I)
StatusBar1(I).Panels(2).Text = "當(dāng)前記錄: " & 1
StatusBar1(I).Panels(3).Text = "今天日期: " & Format(Date, "yyyy 年 m 月 d 日")
StatusBar1(I).Panels(4).Text = "當(dāng)前時(shí)間: " & Time
Exit Sub
X1:
Data1.Recordset.AddNew
StatusBar1(I).Panels(1).Text = "記錄總數(shù): " & 1
StatusBar1(I).Panels(2).Text = "當(dāng)前記錄: " & 1
StatusBar1(I).Panels(3).Text = "今天日期: " & Format(Date, "yyyy 年 m 月 d 日")
StatusBar1(I).Panels(4).Text = "當(dāng)前時(shí)間: " & Time
End Sub
Private Sub DBGrid1_RowColChange(Index As Integer, LastRow As Variant, ByVal LastCol As Integer)
On Error Resume Next
If DBGrid1(I).Columns(2) = "" Then
DBGrid1(I).Columns(2) = Format(Date, "yyyy年m月d日")
End If
If DBGrid1(I).Columns(4) <> "" And IsNumeric(DBGrid1(I).Columns(4)) = False Then
MsgBox " 請(qǐng)輸入數(shù)字 !", vbExclamation, "提示信息"
DBGrid1(I).Columns(4) = ""
Exit Sub
End If
If DBGrid1(I).Columns(5) <> "" And IsNumeric(DBGrid1(I).Columns(5)) = False Then
MsgBox " 請(qǐng)輸入數(shù)字 !", vbExclamation, "提示信息"
DBGrid1(I).Columns(5) = ""
Exit Sub
End If
If DBGrid1(I).Columns(4) = "" Then
DBGrid1(I).Columns(4) = 0
End If
If DBGrid1(I).Columns(5) = "" Then
DBGrid1(I).Columns(5) = 0
End If
DBGrid1(I).Columns(6) = DBGrid1(I).Columns(4) - DBGrid1(I).Columns(5)
End Sub
Private Sub DBGrid1_SelChange(Index As Integer, Cancel As Integer)
StatusBar1(I).Panels(2).Text = "當(dāng)前記錄: " & Data1.Recordset.AbsolutePosition + 1
End Sub
Private Sub Timer1_Timer()
StatusBar1(I).Panels(4).Text = "當(dāng)前時(shí)間: " & Time
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -