📄 purcg.frm
字号:
Width = 1035
End
Begin VB.Label Label5
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "Model"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 225
Left = 4665
TabIndex = 31
Top = 5730
Width = 1245
End
Begin VB.Label Label6
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "Rebate"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 225
Left = 7440
TabIndex = 30
Top = 5715
Width = 990
End
Begin VB.Label Label7
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "Amount"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 225
Left = 8400
TabIndex = 29
Top = 5715
Width = 945
End
Begin VB.Label Label9
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "Item Code"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 225
Left = 2385
TabIndex = 28
Top = 5700
Width = 1230
End
Begin VB.Label Label10
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "Rate"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 225
Left = 6480
TabIndex = 27
Top = 5730
Width = 960
End
Begin VB.Label Label11
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "Qty"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 225
Left = 5925
TabIndex = 26
Top = 5715
Width = 570
End
Begin VB.Label Label12
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "Bill No."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 225
Left = 1395
TabIndex = 25
Top = 5670
Width = 990
End
Begin VB.Label Label13
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "Paid"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 225
Left = 9345
TabIndex = 24
Top = 5685
Width = 1050
End
Begin VB.Label Label14
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "Balance"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 225
Left = 10410
TabIndex = 23
Top = 5700
Width = 1155
End
End
Attribute VB_Name = "purcg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
Text2 = Combo1.Text
Adodc2.RecordSource = "select * from accounts_p where ac_name = '" + Combo1.Text + "'"
Adodc2.Refresh
Label2 = "Previous Balance : " + Str(Adodc2.Recordset.Fields("Balance"))
End Sub
Private Sub Command1_Click()
Adodc1.RecordSource = "select * from trans_pur where date = cdate('" + Text1 + "')"
Adodc1.Refresh
DataGrid1.Refresh
Frame1.Visible = True
End Sub
Private Sub Command11_Click()
MAIN.Show
MAIN.Enabled = True
Unload Me
End Sub
Private Sub Command2_Click()
'<--------------------SAVING INTO TRANS-------------------->
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("Date") = CDate(Text1)
Adodc1.Recordset.Fields("ac_name") = Text2.Text
Adodc1.Recordset.Fields("billno") = Text3.Text
Adodc1.Recordset.Fields("item_code") = Text4.Text
Adodc1.Recordset.Fields("g_head") = Text14.Text
Adodc1.Recordset.Fields("item") = Text5.Text
Adodc1.Recordset.Fields("model") = Text6.Text
Adodc1.Recordset.Fields("qty") = Val(Text8.Text)
Adodc1.Recordset.Fields("rate") = Val(Text7.Text)
Adodc1.Recordset.Fields("rebate") = Val(Text9.Text)
Adodc1.Recordset.Fields("Amount") = Val(Text10.Text)
Adodc1.Recordset.Fields("Paid") = Val(Text12.Text)
Adodc1.Recordset.Fields("Balance") = Val(Text13.Text)
Adodc1.Recordset.Update
'<------------------------------------------------------------->
'<---------------Incr the Stock---------------
Adodc5.RecordSource = "select * from stock where item_code = '" + Text4 + "'"
Adodc5.Refresh
Adodc5.Recordset.Fields("QOH") = Adodc5.Recordset.Fields("QOH") + Adodc1.Recordset.Fields("qty")
Adodc5.Recordset.Update
'<-----------------end of red. of stock--------------
'<------------------Change the Balance Amt.(if applicable)----?
If Val(Text13.Text) > 0 Then
Adodc2.RecordSource = "select * from accounts_p where ac_name = '" + Text2.Text + "'"
Adodc2.Refresh
Adodc2.Recordset.Fields("balance") = Adodc2.Recordset.Fields("balance") + Val(Text13.Text)
Adodc2.Recordset.Update
End If
'<----------------------------End------------------------->
'-----------clear the textboxes-------------
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Text10 = ""
Text12 = ""
Text13 = ""
Me.Tag = ""
Call Form_Activate
Label8 = ""
End Sub
Private Sub DTPicker1_Change()
Text1 = DTPicker1.Value
End Sub
Private Sub Form_Activate()
If Me.Tag = "" Then
DTPicker1.Value = Date
Text1 = Date
Combo1.Clear
While Not Adodc2.Recordset.EOF
Combo1.AddItem Adodc2.Recordset.Fields("Ac_name")
Adodc2.Recordset.MoveNext
Wend
Combo1.SetFocus
End If
If Me.Tag = "called" Then
Text8 = "1"
Text8.SelStart = 0
Text8.SelLength = Len(Text8) - 1
Text8.SetFocus
End If
End Sub
Private Sub Text12_Change()
Text13 = Val(Text10) - Val(Text12)
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
items.Tag = "purcg"
items.Show
Me.Tag = "called"
Me.Enabled = False
End If
End Sub
Private Sub Text8_Change()
Text10 = Val(Text8) * Val(Text7)
Text13 = Text10
End Sub
Private Sub Text9_Change()
Text10 = Val(Text8) * Val(Text7) - Val(Text9)
Text13 = Val(Text10) - Val(Text9)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -