📄 frmchallan.frm
字号:
Left = 915
TabIndex = 60
Top = 6840
Width = 645
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00000000&
Caption = "Challan Entry / Modification"
BeginProperty Font
Name = "Times New Roman"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 840
TabIndex = 59
Top = 120
Width = 9615
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Broker :"
Height = 195
Index = 17
Left = 5085
TabIndex = 58
Top = 2925
Width = 555
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Lot :"
Height = 195
Index = 18
Left = 5085
TabIndex = 57
Top = 1365
Width = 315
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Entry Date :"
Height = 195
Index = 25
Left = 750
TabIndex = 56
Top = 3330
Width = 840
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Contract Date :"
Height = 195
Index = 16
Left = 5085
TabIndex = 55
Top = 2160
Width = 1080
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Contract No.:"
Height = 195
Index = 15
Left = 5085
TabIndex = 54
Top = 1785
Width = 945
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Weight :"
Height = 195
Index = 14
Left = 915
TabIndex = 53
Top = 6435
Width = 600
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Crop Year :"
Height = 195
Index = 13
Left = 750
TabIndex = 52
Top = 1380
Width = 795
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Unit"
Height = 195
Index = 12
Left = 7035
TabIndex = 51
Top = 3795
Width = 285
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Quantity"
Height = 195
Index = 11
Left = 4935
TabIndex = 50
Top = 3795
Width = 585
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Quality"
Height = 195
Index = 10
Left = 2160
TabIndex = 49
Top = 3795
Width = 480
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Mark :"
Height = 195
Index = 9
Left = 5085
TabIndex = 48
Top = 975
Width = 450
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Station :"
Height = 195
Index = 8
Left = 5085
TabIndex = 47
Top = 600
Width = 585
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Seller 2 :"
Height = 195
Index = 7
Left = 5085
TabIndex = 46
Top = 3330
Width = 615
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Seller :"
Height = 195
Index = 6
Left = 5085
TabIndex = 45
Top = 2595
Width = 480
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Ruka No.:"
Height = 195
Index = 5
Left = 750
TabIndex = 44
Top = 2580
Width = 735
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Lorry No.:"
Height = 195
Index = 4
Left = 750
TabIndex = 43
Top = 2910
Width = 690
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Ch.Date :"
Height = 195
Index = 3
Left = 750
TabIndex = 42
Top = 2175
Width = 675
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Challan No. :"
Height = 195
Index = 2
Left = 750
TabIndex = 41
Top = 1800
Width = 915
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Date :"
Height = 195
Index = 1
Left = 750
TabIndex = 40
Top = 1050
Width = 435
End
Begin VB.Label lblFieldLabel
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "JP No. :"
Height = 195
Index = 0
Left = 750
TabIndex = 39
Top = 675
Width = 570
End
End
Attribute VB_Name = "frmChallan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs As ADODB.Recordset
Private Sub cmdChallanSave_Click()
On Error GoTo errh:
env.con.Execute ("INSERT INTO TCHALLAN VALUES('" & txtjpno.Text & "','" & CDate(txtjdate.Text) & "','" & txtchno.Text & "','" & CDate(txtchdate.Text) & "','" & txtlorryno.Text & "','" & txtrukano.Text & "','" & txtseller.Text & "','" & txtseller2.Text & "','" & txtBroker.Text & "','" & txtstation.Text & "','" & txtmark.Text & "'," & _
"'" & txtqlty1.Text & "'," & txtqnty1.Text & ",'" & txtunit1.Text & "','" & txtqlty2.Text & "'," & txtqnty2.Text & ",'" & txtunit2.Text & "','" & txtQlty3.Text & "'," & txtQnty3.Text & ",'" & txtunit3.Text & "','" & txtqlty4.Text & "'," & txtqnty4.Text & ",'" & txtunit4.Text & "'," & _
"'" & txtqlty5.Text & "'," & txtqnty5.Text & ",'" & txtunit5.Text & "','" & txtqlty6.Text & "'," & txtqnty6.Text & ",'" & txtunit6.Text & "','" & txtcropyear.Text & "'," & txtweight.Text & ",'" & txtcontractno.Text & "','" & CDate(txtcontractdate.Text) & "','" & txtlot.Text & "','" & CDate(txtEntryDate.Text) & "','" & txtReason.Text & "')")
MsgBox "Entry Saved", vbInformation
'Setting last jpno
Set rs = env.con.Execute("select isnull(max(substring(jpno,1,4)),0) as lastjpno from tchallan where jdate between (select fromdate from tfyperiod) and (select todate from tfyperiod)")
If rs.EOF = False Then
txtjpno.Text = Format(rs!lastjpno + 1, "0000")
Else
txtjpno.Text = "0001"
End If
Exit Sub
errh:
MsgBox Err.Description, vbCritical
End Sub
Private Sub cmdPrintChallan_Click()
OpenDb
env.con2.Execute ("CREATE TABLE temp(jpno varchar (10),jdate datetime," & _
"chno varchar (15),chdate datetime,lorryno varchar (15),rukano varchar (10),seller varchar (35),seller2 varchar (35)," & _
"broker varchar (40),station varchar (20),mark varchar (25),qlty1 varchar (20),qnty1 numeric(12, 3),unit1 varchar (10)," & _
"qlty2 varchar (20),qnty2 numeric(12, 3),unit2 varchar (10),qlty3 varchar (20),qnty3 numeric(12, 3),unit3 varchar (10)," & _
"qlty4 varchar (20),qnty4 numeric(12, 3),unit4 varchar (10),qlty5 varchar (20),qnty5 numeric(12, 3),unit5 varchar (10)," & _
"qlty6 varchar (20),qnty6 numeric(12, 3),unit6 varchar (10),cropyear varchar (10),weight numeric(12, 3),contractno varchar (20)," & _
"contractdate datetime,lot varchar (5),entrydate datetime,reason varchar(70))")
env.con2.Execute ("create table prmf(rptname varchar(10))")
Set rs = env.con.Execute("select * from tchallan where jpno='" & txtjpno.Text & "'")
env.con2.Execute ("insert into temp values('" & rs!jpno & "','" & rs!jdate & "','" & rs!chno & "','" & CDate(rs!chdate) & "','" & rs!lorryno & "','" & rs!rukano & "','" & rs!seller & "','" & rs!SELLER2 & "','" & rs!broker & "','" & rs!station & "','" & rs!mark & "'," & _
"'" & rs!qlty1 & "'," & rs!qnty1 & ",'" & rs!unit1 & "','" & rs!qlty2 & "'," & rs!qnty2 & ",'" & rs!unit2 & "','" & rs!Qlty3 & "'," & rs!Qnty3 & ",'" & rs!unit3 & "','" & rs!qlty4 & "'," & rs!qnty4 & ",'" & rs!unit4 & "'," & _
"'" & rs!qlty5 & "'," & rs!qnty5 & ",'" & rs!unit5 & "','" & rs!qlty6 & "'," & rs!qnty6 & ",'" & rs!unit6 & "','" & rs!cropyear & "'," & rs!Weight & ",'" & rs!contractno & "','" & CDate(rs!contractdate) & "','" & rs!lot & "','" & rs!EntryDate & "','" & rs!Reason & "')")
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo errh
env.con.Execute ("update tchallan set jdate='" & CDate(txtjdate.Text) & "',chno='" & txtchno.Text & "',chdate='" & CDate(txtchdate.Text) & "',lorryno='" & txtlorryno.Text & "',rukano='" & txtrukano.Text & "',seller='" & txtseller.Text & "',seller2='" & txtseller2.Text & "',broker='" & txtBroker.Text & "',station='" & txtstation.Text & "',mark='" & txtmark.Text & "'," & _
"qlty1='" & txtqlty1.Text & "',qnty1=" & txtqnty1.Text & ",unit1='" & txtunit1.Text & "',qlty2='" & txtqlty2.Text & "',qnty2=" & txtqnty2.Text & ",unit2='" & txtunit2.Text & "',qlty3='" & txtQlty3.Text & "',qnty3=" & txtQnty3.Text & ",unit3='" & txtunit3.Text & "',qlty4='" & txtqlty4.Text & "',qnty4=" & txtqnty4.Text & ",unit4='" & txtunit4.Text & "'," & _
"qlty5='" & txtqlty5.Text & "',qnty5=" & txtqnty5.Text & ",unit5='" & txtunit5.Text & "',qlty6='" & txtqlty6.Text & "',qnty6=" & txtqnty6.Text & ",unit6='" & txtunit6.Text & "',cropyear='" & txtcropyear.Text & "',weight=" & txtweight.Text & ",contractno='" & txtcontractno.Text & "',contractdate='" & CDate(txtcontractdate.Text) & "',lot='" & txtlot.Text & "',entrydate='" & CDate(txtEntryDate.Text) & "','" & txtReason.Text & "')")
MsgBox "Challan Updated", vbInformation
Exit Sub
errh:
MsgBox Err.Description, vbCritical
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
Unload Me
End If
If KeyAscii = 13 Then
SendKeys "{tab}"
SendKeys "{home}+{end}"
End If
End Sub
Private Sub Form_Load()
txtEntryDate.Text = Date
On Error GoTo errh
OpenDb
Set rs = env.con.Execute("select isnull(max(substring(jpno,1,4)),0) as lastjpno from tchallan where jdate between (select fromdate from tfyperiod) and (select todate from tfyperiod)")
If rs.EOF = False Then
txtjpno.Text = Format(rs!lastjpno + 1, "0000")
Else
txtjpno.Text = "0001"
End If
Exit Sub
errh:
MsgBox Err.Description, vbCritical
End Sub
Private Sub txtqlty2_LostFocus()
If Len(Trim(txtqlty2.Text)) = 0 Then txtweight.SetFocus
End Sub
Private Sub txtseller_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
FillSellerList txtseller, txtseller.Text
txtseller.Text = SelectedSellerName
SendKeys "{tab}"
SendKeys "{home}+{end}"
End If
End Sub
Private Sub txtseller2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
FillSellerList txtseller2, txtseller2.Text
txtseller2.Text = SelectedSellerName
SendKeys "{tab}"
SendKeys "{home}+{end}"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -