⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 purchase detail form.frm

📁 This project is to design the automated system for the inventory of Al-Ahmad Cotton and Oil Mills si
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label Label1 
      BackColor       =   &H80000013&
      Caption         =   "Search Purchase Product"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   -1  'True
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2040
      TabIndex        =   21
      Top             =   360
      Width           =   5415
   End
   Begin VB.Label Label4 
      BackColor       =   &H80000013&
      Height          =   975
      Left            =   0
      TabIndex        =   20
      Top             =   0
      Width           =   10095
   End
   Begin VB.Image Image2 
      Height          =   915
      Left            =   -480
      Picture         =   "Purchase Detail Form.frx":1FA86
      Top             =   7200
      Width           =   10620
   End
   Begin VB.Image Image3 
      Height          =   690
      Left            =   9990
      Picture         =   "Purchase Detail Form.frx":3F4E4
      Top             =   6600
      Width           =   525
   End
   Begin VB.Label Label3 
      BackColor       =   &H80000013&
      Height          =   6735
      Left            =   10080
      TabIndex        =   19
      Top             =   0
      Width           =   375
   End
   Begin VB.Image Image1 
      Height          =   8100
      Left            =   10120
      Picture         =   "Purchase Detail Form.frx":4088E
      Top             =   0
      Width           =   1800
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset
Dim rs As New ADODB.Recordset
Dim cnn As New ADODB.Connection
Public callingform As Object


Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Command2_Click()
Grid1.clear
Grid1.Rows = 2
Grid1.TextMatrix(0, 0) = "Invoice Key"
Grid1.TextMatrix(0, 1) = "Invoice No"
Grid1.TextMatrix(0, 2) = "Invoice Date"
Grid1.TextMatrix(0, 3) = "Contract No"
Grid1.TextMatrix(0, 4) = "Supplier Code"
Grid1.TextMatrix(0, 5) = "Supplier Name"
Grid1.TextMatrix(0, 6) = "Product Code"
Grid1.TextMatrix(0, 7) = "Product Name"
Grid1.TextMatrix(0, 8) = "Total Bags"
Grid1.TextMatrix(0, 9) = "W/Bag"
Grid1.TextMatrix(0, 10) = "Total Mounds"
Grid1.TextMatrix(0, 11) = "Rate/Mound"
Grid1.TextMatrix(0, 12) = "Labour Exp"
Grid1.TextMatrix(0, 13) = "Packing Exp"
Grid1.TextMatrix(0, 14) = "Sales Tax"
Grid1.TextMatrix(0, 15) = "Other Exp"
Grid1.TextMatrix(0, 16) = "Net Amount"


'Grid1.TextMatrix(0, 14) = "Pay Amount"
'Grid1.TextMatrix(0, 15) = "Left Amount"
'Grid1.TextMatrix(0, 16) = "Check No"
'Grid1.TextMatrix(0, 17) = "Check Amount"
'Grid1.TextMatrix(0, 18) = "Bank Name"
If Op1.Value = False And Option2.Value = False And Option1.Value = False And Option3.Value = False And Option4.Value = False Then
MsgBox "First Select an Option"
Exit Sub
End If
'//////////////
If rs1.State = adStateOpen Then rs1.Close

rs1.Open " Purchase_Receive_Order_Table ", cnn, adOpenStatic, adLockReadOnly
If rs1.RecordCount = 0 Then
MsgBox " No Record Exists"

Exit Sub
End If
'///////////////////


If Op1.Value = True Then
If code.Text = "" Then
MsgBox "Enter the Contract No"
code.SetFocus
Exit Sub
End If


If rs1.State = adStateOpen Then rs1.Close

rs1.Open " select * from Purchase_Receive_Order_Table where P_Given_Order=" & Val(code.Text), cnn, adOpenStatic, adLockReadOnly
'rs1.Open "select * from Purchase_Receive_Order_Table where P_Receive_Order= '" & rs.Fields("P_Receive_Order") & "'", cnn, adOpenStatic, adLockReadOnly
If rs1.RecordCount = 0 Then
MsgBox " This Contract No has not Received "
code.SetFocus
'Exit Sub
Else
rs1.MoveFirst
While Not rs1.EOF
Grid1.TextMatrix(Grid1.Rows - 1, 0) = rs1.Fields("P_Receive_Order")
Grid1.TextMatrix(Grid1.Rows - 1, 1) = rs1.Fields("Invoice_No")
Grid1.TextMatrix(Grid1.Rows - 1, 2) = rs1.Fields("P_Receive_Date")
Grid1.TextMatrix(Grid1.Rows - 1, 3) = rs1.Fields("P_Given_Order")
Grid1.TextMatrix(Grid1.Rows - 1, 4) = rs1.Fields("Sup_Code")
Grid1.TextMatrix(Grid1.Rows - 1, 16) = rs1.Fields("Net_Amount")

'//////////////////////////////////////


If rs.State = adStateOpen Then rs.Close
'rs.Open " select * from Purchase_Receive_Order_Detail_Table where P_Receive_Order=" & Val(code.Text), cnn, adOpenStatic, adLockReadOnly

rs.Open "select * from Purchase_Receive_Order_Detail_Table where P_Receive_Order= '" & rs1.Fields("P_receive_Order") & "'", cnn, adOpenStatic, adLockReadOnly

Grid1.TextMatrix(Grid1.Rows - 1, 6) = rs.Fields("Product_Code")
Grid1.TextMatrix(Grid1.Rows - 1, 7) = rs.Fields("Product_Name")
Grid1.TextMatrix(Grid1.Rows - 1, 8) = rs.Fields("Total_Bags")
Grid1.TextMatrix(Grid1.Rows - 1, 9) = rs.Fields("W/Bag")
Grid1.TextMatrix(Grid1.Rows - 1, 10) = rs.Fields("Total_Mounds")
Grid1.TextMatrix(Grid1.Rows - 1, 11) = rs.Fields("Rate/Mound")
Grid1.TextMatrix(Grid1.Rows - 1, 12) = rs.Fields("Labour_Exp")
Grid1.TextMatrix(Grid1.Rows - 1, 13) = rs.Fields("Packing_Exp")
Grid1.TextMatrix(Grid1.Rows - 1, 15) = rs.Fields("Other_Exp")
Grid1.TextMatrix(Grid1.Rows - 1, 14) = rs.Fields("Sales_Tax")


'/////////////////////////////////
If rs2.State = adStateOpen Then rs2.Close
rs2.Open "select * from Supplier_Table where Sup_Code=" & rs1.Fields("Sup_Code"), cnn, adOpenStatic, adLockReadOnly
Grid1.TextMatrix(Grid1.Rows - 1, 5) = rs2.Fields("Sup_Name")
'//////////////////////////

Grid1.Rows = Grid1.Rows + 1
rs1.MoveNext
Wend
End If
End If
If Option2.Value = True Then
ad
End If
If Option1.Value = True Then
ad2
End If
If Option4.Value = True Then
atta
End If
If Option3.Value = True Then
atta1
End If
End Sub



Private Sub Command3_Click()
If DataGrid1.Visible = False And sup.Visible = False Then
DataGrid1.Visible = True
sup.Visible = True
Else
DataGrid1.Visible = False
sup.Visible = False
End If
End Sub

Private Sub Command4_Click()
DataGrid1.Visible = False
sup.Visible = False
End Sub

Private Sub Form_Load()
Grid1.Rows = 11
Grid1.TextMatrix(0, 0) = "Invoice Key"
Grid1.TextMatrix(0, 1) = "Invoice No"
Grid1.TextMatrix(0, 2) = "Invoice Date"
Grid1.TextMatrix(0, 3) = "Contract No"
Grid1.TextMatrix(0, 4) = "Supplier Code"
Grid1.TextMatrix(0, 5) = "Supplier Name"
Grid1.TextMatrix(0, 6) = "Product Code"
Grid1.TextMatrix(0, 7) = "Product Name"
Grid1.TextMatrix(0, 8) = "Total Bags"
Grid1.TextMatrix(0, 9) = "W/Bag"
Grid1.TextMatrix(0, 10) = "Total Mounds"
Grid1.TextMatrix(0, 11) = "Rate/Mound"
Grid1.TextMatrix(0, 12) = "Labour Exp"
Grid1.TextMatrix(0, 13) = "Packing Exp"
Grid1.TextMatrix(0, 14) = "Sales Tax"
Grid1.TextMatrix(0, 15) = "Other Exp"
Grid1.TextMatrix(0, 16) = "Net 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 " Purchase_Receive_Order_Table ", cnn, adOpenStatic, adLockReadOnly
If rs1.RecordCount > 0 Then
rs1.MoveFirst
While Not rs1.EOF
Grid1.TextMatrix(Grid1.Rows - 10, 0) = rs1.Fields("P_Receive_Order")
Grid1.TextMatrix(Grid1.Rows - 10, 1) = rs1.Fields("Invoice_No")
Grid1.TextMatrix(Grid1.Rows - 10, 2) = rs1.Fields("P_Receive_Date")
Grid1.TextMatrix(Grid1.Rows - 10, 3) = rs1.Fields("P_Given_Order")
Grid1.TextMatrix(Grid1.Rows - 10, 4) = rs1.Fields("Sup_Code")
Grid1.TextMatrix(Grid1.Rows - 10, 16) = rs1.Fields("Net_Amount")
If rs.State = adStateOpen Then rs.Close
rs.Open "select * from Purchase_Receive_Order_Detail_Table where P_Receive_Order= '" & rs1.Fields("P_Receive_Order") & "'", cnn, adOpenStatic, adLockReadOnly

Grid1.TextMatrix(Grid1.Rows - 10, 6) = rs.Fields("Product_Code")
Grid1.TextMatrix(Grid1.Rows - 10, 7) = rs.Fields("Product_Name")
Grid1.TextMatrix(Grid1.Rows - 10, 8) = rs.Fields("Total_Bags")
Grid1.TextMatrix(Grid1.Rows - 10, 9) = rs.Fields("W/Bag")
Grid1.TextMatrix(Grid1.Rows - 10, 10) = rs.Fields("Total_Mounds")
Grid1.TextMatrix(Grid1.Rows - 10, 11) = rs.Fields("Rate/Mound")
Grid1.TextMatrix(Grid1.Rows - 10, 12) = rs.Fields("Labour_Exp")
Grid1.TextMatrix(Grid1.Rows - 10, 13) = rs.Fields("Packing_Exp")
Grid1.TextMatrix(Grid1.Rows - 10, 15) = rs.Fields("Other_Exp")
Grid1.TextMatrix(Grid1.Rows - 10, 14) = rs.Fields("Sales_Tax")
'//////////////////////////////////////////////////////////
If rs2.State = adStateOpen Then rs2.Close
rs2.Open "select * from Supplier_Table where Sup_Code=" & rs1.Fields("Sup_Code"), cnn, adOpenStatic, adLockReadOnly
Grid1.TextMatrix(Grid1.Rows - 10, 5) = rs2.Fields("Sup_Name")
'//////////////////////////

Grid1.Rows = Grid1.Rows + 1
rs1.MoveNext
Wend

End If
Grid1.ColWidth(0) = 1000
Grid1.ColWidth(1) = 1000
Grid1.ColWidth(3) = 1200
Grid1.ColWidth(4) = 1300
Grid1.ColWidth(5) = 2300
Grid1.ColWidth(7) = 1200
Grid1.ColWidth(8) = 1200
Grid1.ColWidth(9) = 1200

Grid1.ColWidth(10) = 1300
Grid1.ColWidth(11) = 1200
Grid1.ColWidth(14) = 1200
Grid1.ColWidth(2) = 1200
Grid1.ColWidth(6) = 1200
 'fdate.Value = Now
'tdate.Value = Now
End Sub

Private Sub nm_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub Op1_Click()
code.Text = ""
nm.Text = ""
code1.Text = ""
invoice.Text = ""
invoice.Enabled = False
fdate.Enabled = False
tdate.Enabled = False
code1.Enabled = False
code.Enabled = True
nm.Enabled = False
code.SetFocus

End Sub

Private Sub Option_Click()

End Sub

Private Sub Option1_Click()
code.Text = ""
nm.Text = ""
code1.Text = ""
invoice.Text = ""
invoice.Enabled = False
fdate.Enabled = False
tdate.Enabled = False
code1.Enabled = True
code.Enabled = False
nm.Enabled = False
code1.SetFocus
End Sub

Private Sub Option2_Click()
code.Text = ""
nm.Text = ""
code1.Text = ""
invoice.Text = ""
invoice.Enabled = False
tdate.Enabled = False
fdate.Enabled = False
code1.Enabled = False
code.Enabled = False
nm.Enabled = True
nm.SetFocus
End Sub
Public Sub ad()
If Option2.Value = True Then
If nm.Text = "" Then
MsgBox "Enter the Product Name"
nm.SetFocus
Exit Sub
End If
'///////////////////////////////////////

If rs.State = adStateOpen Then rs.Close
rs.Open "select * from Purchase_Receive_Order_Detail_Table where Product_Name= '" & nm.Text & "'", cnn, adOpenStatic, adLockReadOnly
If rs.RecordCount = 0 Then
MsgBox " This Product Record is not available"
nm.SetFocus
'Exit Sub
Else
rs.MoveFirst
While Not rs.EOF
Grid1.TextMatrix(Grid1.Rows - 1, 6) = rs.Fields("Product_Code")
Grid1.TextMatrix(Grid1.Rows - 1, 7) = rs.Fields("Product_Name")
Grid1.TextMatrix(Grid1.Rows - 1, 8) = rs.Fields("Total_Bags")
Grid1.TextMatrix(Grid1.Rows - 1, 9) = rs.Fields("W/Bag")
Grid1.TextMatrix(Grid1.Rows - 1, 10) = rs.Fields("Total_Mounds")
Grid1.TextMatrix(Grid1.Rows - 1, 11) = rs.Fields("Rate/Mound")
Grid1.TextMatrix(Grid1.Rows - 1, 12) = rs.Fields("Labour_Exp")
Grid1.TextMatrix(Grid1.Rows - 1, 13) = rs.Fields("Packing_Exp")
Grid1.TextMatrix(Grid1.Rows - 1, 15) = rs.Fields("Other_Exp")
Grid1.TextMatrix(Grid1.Rows - 1, 14) = rs.Fields("Sales_Tax")

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -