📄 frmupdate.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmUpdate
BackColor = &H80000018&
Caption = "会计科目_修改"
ClientHeight = 5205
ClientLeft = 60
ClientTop = 345
ClientWidth = 6105
Icon = "frmUpdate.frx":0000
LinkTopic = "Form1"
ScaleHeight = 5205
ScaleWidth = 6105
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text3
Height = 375
Left = 600
TabIndex = 11
Text = "false"
Top = 4680
Visible = 0 'False
Width = 1215
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 4080
Top = 3480
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=AISKM.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=AISKM.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
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.CommandButton Command2
Caption = "返回"
Height = 375
Left = 2880
TabIndex = 10
Top = 4080
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "修改"
Height = 375
Left = 1320
TabIndex = 9
Top = 4080
Width = 1215
End
Begin VB.Frame Frame1
BackColor = &H80000018&
Caption = "余额方向"
Height = 1095
Left = 1080
TabIndex = 6
Top = 2640
Width = 2775
Begin VB.OptionButton Option1
BackColor = &H80000018&
Caption = "贷"
Height = 255
Index = 1
Left = 960
TabIndex = 12
Top = 600
Width = 735
End
Begin VB.OptionButton Option1
BackColor = &H80000018&
Caption = "借"
Height = 255
Index = 0
Left = 960
TabIndex = 7
Top = 240
Width = 735
End
End
Begin VB.ComboBox Combo1
Enabled = 0 'False
Height = 300
Left = 2400
TabIndex = 5
Text = "Combo1"
Top = 2160
Width = 1455
End
Begin VB.TextBox Text2
Height = 270
Left = 2400
TabIndex = 1
Top = 1320
Width = 1455
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 270
Left = 2400
TabIndex = 0
Top = 600
Width = 1455
End
Begin VB.Label Label4
BackColor = &H80000018&
Caption = "*科目级长3-2-2"
Height = 255
Left = 3960
TabIndex = 8
Top = 720
Width = 1335
End
Begin VB.Label Label3
BackColor = &H80000018&
Caption = "科目类别"
Height = 255
Left = 1080
TabIndex = 4
Top = 2160
Width = 1215
End
Begin VB.Label Label2
BackColor = &H80000018&
Caption = "科目名称"
Height = 375
Left = 1080
TabIndex = 3
Top = 1320
Width = 1215
End
Begin VB.Label Label1
BackColor = &H80000018&
Caption = "科目代码"
Height = 375
Left = 1080
TabIndex = 2
Top = 600
Width = 1095
End
End
Attribute VB_Name = "frmUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text3.Text = "false" Then
Text2.Enabled = True
Option1(0).Enabled = True
Option1(1).Enabled = True
Text3.Text = "true"
Else
Adodc1.RecordSource = "select * from kmzd where 科目代码='" + Text1.Text + "'"
Adodc1.Refresh
Adodc1.Recordset.Update
Adodc1.Recordset(1) = Text2.Text
If Option1(0).Value = True Then
Adodc1.Recordset(3).Value = Option1(0).Caption
Else
Adodc1.Recordset(3).Value = Option1(1).Caption
End If
Adodc1.Recordset.Update
Adodc1.Refresh
frmQuerry.Adodc1.Refresh
frmQuerry.DataGrid1.Refresh
Text3.Text = "false"
Text2.Enabled = False
Option1(0).Enabled = False
Option1(1).Enabled = False
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Adodc1.RecordSource = "select * from kmzd where 科目代码='" + frmQuerry.DataGrid1.Columns(0).Text + "'"
Adodc1.Refresh
Do While Not Adodc1.Recordset.EOF
Text1.Text = Adodc1.Recordset(0).Value
Text2.Text = Adodc1.Recordset(1).Value
Combo1.Text = Adodc1.Recordset(2).Value
If Adodc1.Recordset(0).Value = "借" Then
Option1(0).Value = True
Else
Option1(1).Value = True
End If
Adodc1.Recordset.MoveNext
Text2.Enabled = False
Option1(0).Enabled = False
Option1(1).Enabled = False
Loop
End Sub
Private Sub frmAdd_DragDrop(Source As Control, X As Single, Y As Single)
Adodc1.RecordSource = "select * from kmzd where 科目代码='" + frmKjkm.DataGrid1.Columns(0).Text + "'"
Adodc1.Refresh
Do While Not Adodc1.Recordset.EOF
Text1.Text = Adodc1.Recordset(0).Value
Text2.Text = Adodc1.Recordset(1).Value
Combo1.Text = Adodc1.Recordset(2).Value
If Adodc1.Recordset(0).Value = "借" Then
Option1(0).Value = True
Else
Option1(1).Value = True
End If
Adodc1.Recordset.MoveNext
Loop
End Sub
Private Sub Option1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Str As Integer
Str = MsgBox("你确定要更改余额方向吗?它是和科目类别相关的", vbYesNo + vbQuestion, "信息提示")
If Str = vbYes And Option1(1).Value = True Then
Option1(0) = Not Option1(0).Value
ElseIf Str = vbYes And Option1(0).Value = True Then
Option1(1) = Not Option1(1).Value
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii > 48 And KeyAscii < 57 Then
KeyAscii = 0
MsgBox "请不要输入数字"
End If
If KeyAscii = 13 Then
Option1(0).SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -