📄 grid of sale receive order.frm
字号:
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=hussain"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=hussain"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "Sale_Receive_Order_Table"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Image Image5
Height = 585
Left = 9855
Picture = "grid of sale receive order.frx":0040
Top = 6925
Width = 615
End
Begin VB.Label Label3
BackColor = &H80000013&
Height = 7095
Left = 10080
TabIndex = 21
Top = 0
Width = 375
End
Begin VB.Image Image4
Height = 915
Left = -480
Picture = "grid of sale receive order.frx":1366
Top = 7520
Width = 10620
End
Begin VB.Image Image3
Height = 8460
Left = 10120
Picture = "grid of sale receive order.frx":20DC4
Top = 0
Width = 1800
End
Begin VB.Image Image2
Height = 8460
Left = 1.00100e5
Picture = "grid of sale receive order.frx":52726
Top = 0
Width = 1800
End
Begin VB.Image Image1
Height = 8460
Left = 1.01200e5
Picture = "grid of sale receive order.frx":84088
Top = 0
Width = 1800
End
Begin VB.Label Label1
BackColor = &H80000013&
Caption = "Search Sale Contract"
BeginProperty Font
Name = "Times New Roman"
Size = 24
Charset = 0
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 2520
TabIndex = 0
Top = 360
Width = 4575
End
End
Attribute VB_Name = "Form27"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public callingform As Object
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs As New ADODB.Recordset
Dim cnn As New ADODB.Connection
Private Sub Cancel_Click()
Unload Me
'37.324
End Sub
Private Sub cust_Click()
End Sub
Private Sub Form_Load()
Grid1.ColWidth(6) = 1300
Grid1.ColWidth(8) = 1300
Grid1.TextMatrix(0, 0) = "Contract No"
Grid1.TextMatrix(0, 1) = "Contract Date"
Grid1.TextMatrix(0, 2) = "Valid Upto"
Grid1.TextMatrix(0, 3) = "Customer Code"
Grid1.TextMatrix(0, 4) = "Customer Name"
Grid1.TextMatrix(0, 5) = "Product Code"
Grid1.TextMatrix(0, 6) = "Product Name"
Grid1.TextMatrix(0, 7) = "Total Qty(Mn)"
Grid1.TextMatrix(0, 8) = "Total Qty(Kgs)"
Grid1.TextMatrix(0, 9) = "Rate/Mn"
Grid1.TextMatrix(0, 10) = "Total Amount"
If cnn.State = adStateOpen Then cnn.Close
cnn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=hussain"
If rs1.State = adStateOpen Then rs1.Close
rs1.Open "Sale_Receive_Order_Table", cnn, adOpenStatic, adLockReadOnly
If rs1.RecordCount > 0 Then
rs1.MoveFirst
While Not rs1.EOF
Grid1.TextMatrix(Grid1.Rows - 1, 0) = rs1.Fields("S_Receive_Order")
Grid1.TextMatrix(Grid1.Rows - 1, 1) = rs1.Fields("Order_Date")
Grid1.TextMatrix(Grid1.Rows - 1, 2) = rs1.Fields("Valid_Date")
Grid1.TextMatrix(Grid1.Rows - 1, 3) = rs1.Fields("Cust_Id")
'Grid1.TextMatrix(Grid1.Rows - 1, 4) = rs1.Fields("Cust_Name")
If rs.State = adStateOpen Then rs.Close
rs.Open "select * from Sale_Receive_Order_Detail_Table where S_Receive_Order= '" & rs1.Fields("S_Receive_Order") & "'", cnn, adOpenStatic, adLockReadOnly
Grid1.TextMatrix(Grid1.Rows - 1, 5) = rs.Fields("Product_Code")
Grid1.TextMatrix(Grid1.Rows - 1, 6) = rs.Fields("Product_Name")
Grid1.TextMatrix(Grid1.Rows - 1, 7) = rs.Fields("Total_Mounds")
Grid1.TextMatrix(Grid1.Rows - 1, 9) = rs.Fields("Rate/Mn")
Grid1.TextMatrix(Grid1.Rows - 1, 8) = Val(rs.Fields("Total_Mounds")) * 37.324
Grid1.TextMatrix(Grid1.Rows - 1, 10) = Val(rs.Fields("Rate/Mn")) * Val(rs.Fields("Total_Mounds"))
'//////////////////////
If rs2.State = adStateOpen Then rs2.Close
rs2.Open "select * from Customer_Table where Cust_Id=" & rs1.Fields("Cust_Id"), cnn, adOpenStatic, adLockReadOnly
Grid1.TextMatrix(Grid1.Rows - 1, 4) = rs2.Fields("Cust_Name")
Grid1.Rows = Grid1.Rows + 1
rs1.MoveNext
Wend
End If
'Grid1.ColWidth(0) = 1000
Grid1.ColWidth(1) = 1200
Grid1.ColWidth(2) = 1300
Grid1.ColWidth(3) = 1200
Grid1.ColWidth(4) = 2300
Grid1.ColWidth(5) = 1200
Grid1.ColWidth(7) = 1200
Grid1.ColWidth(9) = 1200
Grid1.ColWidth(10) = 1200
'cd1.Value = Now
'tdate.Value = Now
'vu.Value = Now
End Sub
Private Sub Op1_Click()
code.Text = ""
pn.Text = ""
Text1.Text = ""
pn.Enabled = False
cd1.Enabled = False
tdate.Enabled = False
vu.Enabled = False
Text1.Enabled = False
code.Enabled = True
code.SetFocus
End Sub
Private Sub Option1_Click()
code.Text = ""
pn.Text = ""
Text1.Text = ""
pn.Enabled = False
cd1.Enabled = False
tdate.Enabled = False
vu.Enabled = False
code.Enabled = False
Text1.Enabled = True
Text1.SetFocus
End Sub
Private Sub Option2_Click()
code.Text = ""
Text1.Text = ""
pn.Text = ""
code.Enabled = False
Text1.Enabled = False
tdate.Enabled = False
pn.Enabled = True
cd1.Enabled = False
vu.Enabled = False
pn.SetFocus
End Sub
Private Sub Option3_Click()
code.Text = ""
Text1.Text = ""
pn.Text = ""
code.Enabled = False
Text1.Enabled = False
tdate.Enabled = False
pn.Enabled = False
cd1.Enabled = False
vu.Enabled = True
vu.SetFocus
End Sub
Private Sub Option4_Click()
code.Text = ""
Text1.Text = ""
pn.Text = ""
code.Enabled = False
Text1.Enabled = False
pn.Enabled = False
cd1.Enabled = True
tdate.Enabled = True
vu.Enabled = False
cd1.SetFocus
End Sub
Private Sub search_Click()
Grid1.clear
Grid1.Rows = 2
Grid1.ColWidth(6) = 1300
Grid1.ColWidth(8) = 1300
Grid1.TextMatrix(0, 0) = "Contract No"
Grid1.TextMatrix(0, 1) = "Contract Date"
Grid1.TextMatrix(0, 2) = "Valid Upto"
Grid1.TextMatrix(0, 3) = "Customer Code"
Grid1.TextMatrix(0, 4) = "Customer Name"
Grid1.TextMatrix(0, 5) = "Product Code"
Grid1.TextMatrix(0, 6) = "Product Name"
Grid1.TextMatrix(0, 7) = "Total Qty(Mn)"
Grid1.TextMatrix(0, 8) = "Total Qty(Kgs)"
Grid1.TextMatrix(0, 9) = "Rate/Mn"
Grid1.TextMatrix(0, 10) = "Total Amount"
'//////////////
If rs1.State = adStateOpen Then rs1.Close
rs1.Open " Sale_Receive_Order_Table ", cnn, adOpenStatic, adLockReadOnly
If rs1.RecordCount = 0 Then
MsgBox " No Record Exists"
Exit Sub
End If
'///////////////////
If Op1.Value = False And Option2.Value = False And Option3.Value = False And Option4.Value = False And Option1.Value = False Then
MsgBox "First Select an Option"
Else
If Op1.Value = True Then
If code.Text = "" Then
MsgBox "Please Give Customer Code"
Else
If rs.State = adStateOpen Then rs.Close
rs.Open "select * from Sale_Receive_Order_Table where Cust_Id='" & Val(code.Text) & "'", cnn, adOpenStatic, adLockReadOnly
If rs.RecordCount = 0 Then
MsgBox "Required Record is not Present"
code.SetFocus
Exit Sub
Else
rs.MoveFirst
While Not rs.EOF
Grid1.TextMatrix(Grid1.Rows - 1, 0) = rs.Fields("S_Receive_Order")
Grid1.TextMatrix(Grid1.Rows - 1, 1) = rs.Fields("Order_Date")
Grid1.TextMatrix(Grid1.Rows - 1, 2) = rs.Fields("Valid_Date")
Grid1.TextMatrix(Grid1.Rows - 1, 3) = rs.Fields("Cust_Id")
'Grid1.TextMatrix(Grid1.Rows - 1, 4) = rs.Fields("Cust_Name")
If rs1.State = adStateOpen Then rs1.Close
rs1.Open "select * from Sale_Receive_Order_Detail_Table where S_Receive_Order='" & rs.Fields("S_Receive_Order") & "'", cnn, adOpenStatic, adLockReadOnly
Grid1.TextMatrix(Grid1.Rows - 1, 5) = rs1.Fields("Product_Code")
Grid1.TextMatrix(Grid1.Rows - 1, 6) = rs1.Fields("Product_Name")
Grid1.TextMatrix(Grid1.Rows - 1, 7) = rs1.Fields("Total_Mounds")
Grid1.TextMatrix(Grid1.Rows - 1, 9) = rs1.Fields("Rate/Mn")
Grid1.TextMatrix(Grid1.Rows - 1, 8) = Val(rs1.Fields("Total_Mounds") * 37.324)
Grid1.TextMatrix(Grid1.Rows - 1, 10) = Val(rs1.Fields("Rate/Mn")) * Val(rs1.Fields("Total_Mounds"))
'//////////////////
'//////////////////////
If rs2.State = adStateOpen Then rs2.Close
rs2.Open "select * from Customer_Table where Cust_Id=" & rs.Fields("Cust_Id"), cnn, adOpenStatic, adLockReadOnly
Grid1.TextMatrix(Grid1.Rows - 1, 4) = rs2.Fields("Cust_Name")
'//////////////////////
Grid1.Rows = Grid1.Rows + 1
rs.MoveNext
Wend
End If
End If
Else
'ad
ahmad
ad1
ad2
atta
End If
End If
End Sub
'search the record by customer name
Public Sub ad()
If Option1.Value = True Then
If nm.Text = "" Then
MsgBox "Please Give the Customer Name"
Else
If rs.State = adStateOpen Then rs.Close
rs.Open " select * from Sale_Receive_order_Table where Cust_Name Like'%" & Trim(nm.Text) & "%'", cnn, adOpenStatic, adLockReadOnly
If rs.RecordCount = 0 Then
MsgBox "Required Record does not Exists"
Exit Sub
Else
rs.MoveFirst
While Not rs.EOF
Grid1.TextMatrix(Grid1.Rows - 1, 0) = rs.Fields("S_Receive_Order")
Grid1.TextMatrix(Grid1.Rows - 1, 1) = rs.Fields("Order_Date")
Grid1.TextMatrix(Grid1.Rows - 1, 2) = rs.Fields("Valid_Date")
Grid1.TextMatrix(Grid1.Rows - 1, 3) = rs.Fields("Cust_Id")
Grid1.TextMatrix(Grid1.Rows - 1, 4) = rs.Fields("Cust_Name")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -