?? frmmain.frm
字號:
DataField = "單位"
Caption = "單位"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column05
DataField = "單價(jià)"
Caption = "單價(jià)"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column06
DataField = "合價(jià)"
Caption = "合價(jià)"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
Object.Visible = 0 'False
ColumnWidth = 1094.74
EndProperty
BeginProperty Column01
ColumnWidth = 1184.882
EndProperty
BeginProperty Column02
ColumnWidth = 2910.047
EndProperty
BeginProperty Column03
ColumnWidth = 1154.835
EndProperty
BeginProperty Column04
ColumnWidth = 1289.764
EndProperty
BeginProperty Column05
ColumnWidth = 1560.189
EndProperty
BeginProperty Column06
ColumnWidth = 1874.835
EndProperty
EndProperty
End
Begin VB.Label Label3
BorderStyle = 1 'Fixed Single
Height = 375
Left = 4200
TabIndex = 9
Top = 360
Width = 6495
End
Begin VB.Label Label2
Caption = "數(shù)量:"
Height = 375
Left = 360
TabIndex = 4
Top = 1080
Width = 855
End
Begin VB.Label Label1
Caption = "編碼:"
Height = 375
Left = 360
TabIndex = 3
Top = 360
Width = 855
End
Begin VB.Menu Basedo
Caption = "基本操作(&B)"
Begin VB.Menu UserM
Caption = "用戶管理(&U)"
End
Begin VB.Menu DockM
Caption = "倉庫管理(&D)"
End
Begin VB.Menu SaleM
Caption = "銷售管理(&S)"
End
Begin VB.Menu EmpolyM
Caption = "員工管理(&E)"
End
End
Begin VB.Menu myHelp
Caption = "幫助(&H)"
Begin VB.Menu myAbout
Caption = "關(guān)于(&A)"
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Num As Double
Private Sub Command1_Click()
With Adodc1.Recordset
.AddNew
.Fields(1) = Text1.Text
.Fields(2) = Adodc2.Recordset.Fields(2)
.Fields(3) = Text2.Text
.Fields(4) = Adodc2.Recordset.Fields(4)
.Fields(5) = Adodc2.Recordset.Fields(3)
.Fields(6) = Format(Val(Adodc2.Recordset.Fields(3)) * Val(Text2.Text), "fixed")
If Not .EOF Then .MoveNext
.Requery
End With
With Adodc2.Recordset
.Fields(5) = Num - Val(Text2.Text)
.Update
End With
Text1.Text = ""
Text2.Text = ""
Label3.Caption = ""
Text1.SetFocus
End Sub
Private Sub Command2_Click()
With Adodc2
.CommandType = adCmdText
.ConnectionString = getDbStr
If Not Adodc1.Recordset.EOF Then
tmp = Adodc1.Recordset.Fields(1).Value
Else
tmp = ""
End If
If tmp = "" Then
tmp = " "
Else
tmp = Adodc1.Recordset.Fields(1).Value
End If
.RecordSource = "select * from 倉庫表 where 編號='" & tmp & "'"
.Refresh
If Not .Recordset.EOF Then
.Recordset.Fields(5) = Val(.Recordset.Fields(5)) + Val(Adodc1.Recordset.Fields(3).Value)
.Recordset.Update
End If
End With
With Adodc1.Recordset
If Not .EOF Then
.Delete
.MoveNext
.Requery
End If
End With
End Sub
Private Sub Command3_Click()
frmDockB.Show 0, Me
End Sub
Private Sub Command4_Click()
Command4.Enabled = False
With Adodc1.Recordset
If Not .EOF Then
Do Until .EOF
With Adodc3.Recordset
.AddNew
.Fields(1) = Now
.Fields(2) = Adodc1.Recordset.Fields(1).Value
.Fields(3) = Adodc1.Recordset.Fields(2).Value
.Fields(4) = Adodc1.Recordset.Fields(5).Value
.Fields(5) = Adodc1.Recordset.Fields(4).Value
.Fields(6) = Adodc1.Recordset.Fields(3).Value
.Fields(7) = Adodc1.Recordset.Fields(6).Value
.Fields(8) = getManager
If Not .EOF Then .MoveNext
.Requery
End With
If Not .EOF Then .MoveNext
Loop
If .RecordCount > 0 Then .MoveFirst
Do Until .EOF
.Delete
.MoveNext
Loop
MsgBox "入庫成功!", vbInformation, "成功"
End If
End With
Command4.Enabled = True
End Sub
Private Sub Command5_Click()
Unload Me
End Sub
Private Sub DockM_Click()
frmDock.Show 1, Me
End Sub
Private Sub EmpolyM_Click()
frmEmp.Show 1, Me
End Sub
Private Sub Form_Activate()
Text1.SetFocus
End Sub
Private Sub Form_Load()
Call ResizeInit(Me)
With Adodc1
.CommandType = adCmdText
.ConnectionString = getDbStr
.RecordSource = "select * from 臨時(shí)表"
.Refresh
End With
With Adodc1.Recordset
Do Until .EOF
.Delete
.MoveNext
Loop
End With
With Adodc3
.CommandType = adCmdText
.ConnectionString = getDbStr
.RecordSource = "select * from 銷售表"
.Refresh
End With
If getManager = "系統(tǒng)管理員" Then
Basedo.Enabled = True
Else
Basedo.Enabled = False
End If
StatusBar1.SimpleText = "新時(shí)代超市管理系統(tǒng)1.0" & " " & "制作人:季洪彬" & " 您的登錄時(shí)間:" & Now & " 操作員:" & getManager
'Unload frmSplash
End Sub
Private Sub Form_Resize()
Call ResizeForm(Me)
End Sub
Private Sub myAbout_Click()
frmAbout.Show 1, Me
End Sub
Private Sub SaleM_Click()
frmSale.Show 1, Me
End Sub
Private Sub Text1_Change()
Call delErr(Text1)
With Adodc2
.CommandType = adCmdText
.ConnectionString = getDbStr
tmp = Text1.Text
If tmp = "" Then
tmp = " "
Else
tmp = Text1.Text
End If
.RecordSource = "select * from 倉庫表 where 編號='" & tmp & "'"
.Refresh
End With
If Not Adodc2.Recordset.EOF Then
Num = Val(Adodc2.Recordset.Fields(5).Value)
Label3.Caption = "名稱:" & Adodc2.Recordset.Fields(2).Value & " 庫存數(shù)量:" & Num & _
Adodc2.Recordset.Fields(4).Value
Else
Label3.Caption = "無庫存"
End If
End Sub
Private Sub Text2_Change()
Call chkTxt(Text2)
If IsNumeric(Text2.Text) And Val(Text2.Text) > 0 And Val(Text2.Text) <= Num Then
Command1.Enabled = True
Else
Command1.Enabled = False
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Command1.Enabled = True Then
Command1_Click
Text1.SetFocus
End If
End Sub
Private Sub UserM_Click()
frmUser.Show 1, Me
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -