?? menu12.frm
字號:
Caption = "單位"
Height = 255
Left = 6120
TabIndex = 18
Top = 2115
Width = 615
End
Begin VB.Label Label43
BackStyle = 0 'Transparent
Caption = "條碼"
Height = 255
Left = 3480
TabIndex = 17
Top = 2115
Width = 1575
End
Begin VB.Label Label44
BackStyle = 0 'Transparent
Caption = "作者"
Height = 255
Left = 3480
TabIndex = 16
Top = 1800
Width = 735
End
Begin VB.Label xttime
BackStyle = 0 'Transparent
Caption = "系統日期"
Height = 255
Left = 240
TabIndex = 15
Top = 1080
Width = 2895
End
Begin VB.Label Label40
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "科類"
Height = 180
Left = 9000
TabIndex = 14
Top = 2115
Width = 360
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "流水號:"
Height = 255
Left = 8880
TabIndex = 13
Top = 1080
Width = 735
End
Begin VB.Label lalsh
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 9720
TabIndex = 12
Top = 1080
Width = 1800
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "出版社"
Height = 255
Left = 6000
TabIndex = 11
Top = 1740
Width = 975
End
End
End
Attribute VB_Name = "winmenu12"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim whattodo As String '判定執行的是毛重還是皮重
Private Sub bgclear()
Do While bg.Rows - 1 > 1
bg.RemoveItem (1)
Loop
bg.Row = 1
bg.Col = 0: bg.Text = ""
bg.Col = 1: bg.Text = ""
bg.Col = 2: bg.Text = ""
bg.Col = 3: bg.Text = ""
bg.Col = 4: bg.Text = ""
bg.Col = 5: bg.Text = ""
bg.Col = 6: bg.Text = ""
bg.Col = 7: bg.Text = ""
End Sub
Private Sub intobg()
On Error Resume Next
Do Until tab3.EOF
b0 = tab3("bh")
b1 = tab3("name")
b2 = tab3("man")
b3 = tab3("cbs")
b4 = tab3("cbrq")
b5 = tab3("lb")
b6 = tab3("price")
b7 = tab3("sl")
bg.Row = 1
bg.Col = 0
If bg.Text = "" Then
bg.Row = 1
bg.Col = 0: bg.Text = b0
bg.Col = 1: bg.Text = b1
bg.Col = 2: bg.Text = b2
bg.Col = 3: bg.Text = b3
bg.Col = 4: bg.Text = b4
bg.Col = 5: bg.Text = b5
bg.Col = 6: bg.Text = b6
bg.Col = 7: bg.Text = b7
Else
bg.AddItem (b0 & vbTab & b1 & vbTab & b2 & vbTab & b3 & vbTab & b4 & vbTab & b5 & vbTab & b6 & vbTab & b7)
End If
tab3.MoveNext
Loop
End Sub
Private Sub lrok()
tename.Locked = False
teman.Locked = False
cocbs.Locked = False
teprice.Locked = False
tenumber.Locked = False
codw.Locked = False
colb.Locked = False
cobz.Locked = False
tesay.Locked = False
teremark.Locked = False
tecbrq.Locked = False
tesl.Locked = False
End Sub
Private Sub lrcancel()
'設定可錄入的TEXT框為不可用
tename.Locked = True
tename = ""
teman.Locked = True
teman = ""
cocbs.Locked = True
cocbs = ""
teprice.Locked = True
teprice = ""
tenumber.Locked = True
tenumber = ""
codw.Locked = True
codw = ""
colb.Locked = True
colb = ""
cobz.Locked = True
cobz = ""
tesay.Locked = True
tesay = ""
teremark.Locked = True
teremark = ""
tecbrq.Locked = True
tecbrq = ""
lalsh = ""
tesl.Locked = True
tesl = ""
End Sub
Private Sub coadd_Click()
whattodo = "add"
lrok
coadd.Enabled = False
comodi.Enabled = False
cocancel.Enabled = True
cosave.Enabled = True
Set tab1 = data2.OpenRecordset("select * from ruku order by val(bh) ")
If tab1.EOF Then
lalsh.Caption = "1"
Else
tab1.MoveLast
lalsh.Caption = Val(tab1("bh")) + 1
End If
tename.SetFocus
End Sub
Private Sub cocancel_Click()
coadd.Enabled = True
comodi.Enabled = True
cocancel.Enabled = False
cosave.Enabled = False
lrcancel
End Sub
Private Sub comodi_Click()
Set tab1 = data2.OpenRecordset("select * from ruku order by val(bh)")
If tab1.EOF Then MsgBox "庫中無數據,請首先作錄入!": Exit Sub
sta:
s1 = mainboot.Left + 2200
s2 = mainboot.Top + 3800
ss = InputBox("請輸入要進行修改的流水編號:", "修改", , s1, s2)
If ss = "" Then Exit Sub
Set tab1 = data2.OpenRecordset("select * from ruku where bh='" + ss + "'")
If tab1.EOF Then
YesNo = MsgBox("無此流水編號,是否繼續進行錄入?", vbYesNo + vbQuestion, "圖書管理系統")
If YesNo = vbYes Then
GoTo sta:
Exit Sub
Else
Exit Sub
End If
Else
lalsh = ss
tename = tab1("name")
teman = tab1("man")
cocbs = tab1("cbs")
teprice = tab1("price")
tenumber = tab1("num")
codw = tab1("dw")
colb = tab1("lb")
cobz = tab1("bz")
tesay = tab1("say")
teremark = tab1("remark")
tesay = tab1("say")
tecbrq = tab1("cbrq")
lrok
End If
whattodo = "modi"
coadd.Enabled = False
comodi.Enabled = False
cocancel.Enabled = True
cosave.Enabled = True
End Sub
Private Sub coquit_Click()
Unload Me
End Sub
Private Sub cosave_Click()
If Trim(tename) = "" Then
MsgBox "對不起,書名不能為空!", vbExclamation + vbOKOnly, "圖書管理系統"
tename.SetFocus
Exit Sub
End If
If teman = "" Then teman = " "
If cocbs = "" Then cocbs = " "
If teprice = "" Then teprie = " "
If tenumber = "" Then tenumber = " "
If codw = "" Then codw = " "
If colb = "" Then colb = " "
If cobz = "" Then cobz = " "
If tesay = "" Then tesay = ""
If teremark = "" Then teremark = " "
If tecbrq = "" Then tecbrq = " "
If whattodo = "add" Then
data2.Execute "insert into ruku (name,man,cbs,price,num,dw,lb,bz,say,remark,bh,rq,time1,czy,cbrq,sl) values ('" + tename + "','" + teman + "','" + cocbs + "','" + teprice + "','" + tenumber + "','" + codw + "','" + colb + "','" + cobz + "','" + tesay + "','" + teremark + "','" + lalsh + " ','" + Date$ + "','" + Time$ + "','" + teczy + "','" + tecbrq + "','" + tesl + "')"
Set tab3 = data2.OpenRecordset("select * from ruku where bh='" + lalsh.Caption + "'")
intobg
Else
data2.Execute "update ruku set name='" + tename + "',man='" + teman + "',cbs='" + cocbs + "',price='" + teprice + "',num ='" + tenumber + "',dw='" + codw + "',lb='" + colb + "',bz='" + cobz + "',say='" + tesay + "',remark='" + teremark + "',bh='" + lalsh + "',rq='" + Date$ + "',time1='" + Time$ + "',czy='" + teczy + "',cbrq='" + tecbrq + "' where bh='" + lalsh + "' "
End If
lrcancel
coadd.Enabled = True
comodi.Enabled = True
cocancel.Enabled = False
cosave.Enabled = False
End Sub
Private Sub Form_Load()
Set myname = data1.OpenRecordset("table1")
Me.Caption = myname("mainame") + "圖書管理系統"
Frame1.Visible = True
Me.Left = 0
Me.Top = 0
Me.Width = 12120 - 190 '9540
Me.Height = 8700 - 750 '6144
Frame1.Left = 0
Frame1.Top = 0
Frame1.Width = 12120 - 190
Frame1.Height = 8700 - 450
xttime.Caption = Str$(Year(DateValue(Date$))) + "年" + Str$(Month(DateValue(Date$))) + "月" + Str$(Day(DateValue(Date$))) + "日" + Str$(Hour(Time())) + "時" + Str$(Minute(Time())) + "分" + Str$(Second(Time())) + "秒"
Set tab3 = data2.OpenRecordset("select * from ruku order by val(bh)")
If Not tab3.EOF Then intobg
Set tab2 = data1.OpenRecordset("QXK")
teczy.Text = tab2.Fields("cjyxm")
cocbs.Clear '車型
Set tab1 = data1.OpenRecordset("cbs")
Do Until tab1.EOF
cocbs.AddItem tab1("cbs")
tab1.MoveNext
Loop
codw.Clear '車型
Set tab1 = data1.OpenRecordset("dw")
Do Until tab1.EOF
codw.AddItem tab1("dw")
tab1.MoveNext
Loop
colb.Clear '車型
Set tab1 = data1.OpenRecordset("lb")
Do Until tab1.EOF
colb.AddItem tab1("lb")
tab1.MoveNext
Loop
cobz.Clear '車型
Set tab1 = data1.OpenRecordset("bz")
Do Until tab1.EOF
cobz.AddItem tab1("bz")
tab1.MoveNext
Loop
coadd.Enabled = True
comodi.Enabled = True
cocancel.Enabled = False
cosave.Enabled = False
lrcancel
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
mainboot.Picture1.Visible = True
End Sub
Private Sub Timer1_Timer()
xttime.Caption = Str$(Year(DateValue(Date$))) + "年" + Str$(Month(DateValue(Date$))) + "月" + Str$(Day(DateValue(Date$))) + "日" + Str$(Hour(Time())) + "時" + Str$(Minute(Time())) + "分" + Str$(Second(Time())) + "秒"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -