Form4.frm
上传用户:xzhdjhq
上传日期:2013-04-04
资源大小:302k
文件大小:11k
源码类别:

软件工程

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form Form4 
  3.    BorderStyle     =   5  'Sizable ToolWindow
  4.    Caption         =   "物资基本信息管理"
  5.    ClientHeight    =   5835
  6.    ClientLeft      =   2565
  7.    ClientTop       =   2295
  8.    ClientWidth     =   8745
  9.    LinkTopic       =   "Form4"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   5835
  13.    ScaleWidth      =   8745
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.CommandButton Command5 
  16.       Caption         =   "退出"
  17.       Height          =   375
  18.       Left            =   5760
  19.       TabIndex        =   26
  20.       Top             =   4920
  21.       Width           =   2055
  22.    End
  23.    Begin VB.Frame Frame3 
  24.       Caption         =   "物资基本信息"
  25.       Height          =   2415
  26.       Left            =   720
  27.       TabIndex        =   12
  28.       Top             =   2400
  29.       Width           =   7455
  30.       Begin VB.TextBox Text6 
  31.          Height          =   375
  32.          Left            =   5640
  33.          TabIndex        =   28
  34.          Top             =   480
  35.          Width           =   1095
  36.       End
  37.       Begin VB.TextBox Text10 
  38.          Height          =   375
  39.          Left            =   3360
  40.          TabIndex        =   25
  41.          Top             =   1680
  42.          Width           =   1065
  43.       End
  44.       Begin VB.TextBox Text9 
  45.          Height          =   375
  46.          Left            =   1200
  47.          TabIndex        =   24
  48.          Top             =   1680
  49.          Width           =   1095
  50.       End
  51.       Begin VB.TextBox Text8 
  52.          Height          =   375
  53.          Left            =   5640
  54.          TabIndex        =   23
  55.          Top             =   1680
  56.          Width           =   1095
  57.       End
  58.       Begin VB.TextBox Text5 
  59.          Height          =   375
  60.          Left            =   3600
  61.          TabIndex        =   22
  62.          Top             =   480
  63.          Width           =   1095
  64.       End
  65.       Begin VB.TextBox Text4 
  66.          Height          =   375
  67.          Left            =   1320
  68.          TabIndex        =   21
  69.          Top             =   480
  70.          Width           =   1095
  71.       End
  72.       Begin VB.Label Label9 
  73.          Caption         =   "单价:"
  74.          Height          =   375
  75.          Left            =   4920
  76.          TabIndex        =   27
  77.          Top             =   480
  78.          Width           =   1095
  79.       End
  80.       Begin VB.Label Label13 
  81.          Caption         =   "金额:"
  82.          Height          =   495
  83.          Left            =   2760
  84.          TabIndex        =   20
  85.          Top             =   1800
  86.          Width           =   1095
  87.       End
  88.       Begin VB.Label Label12 
  89.          Caption         =   "数量:"
  90.          Height          =   495
  91.          Left            =   720
  92.          TabIndex        =   19
  93.          Top             =   1800
  94.          Width           =   1095
  95.       End
  96.       Begin VB.Label Label11 
  97.          Caption         =   "计量单位:"
  98.          Height          =   375
  99.          Left            =   4680
  100.          TabIndex        =   18
  101.          Top             =   1680
  102.          Width           =   975
  103.       End
  104.       Begin VB.Label Label5 
  105.          Caption         =   "物资名称:"
  106.          Height          =   375
  107.          Left            =   2640
  108.          TabIndex        =   14
  109.          Top             =   480
  110.          Width           =   975
  111.       End
  112.       Begin VB.Label Label4 
  113.          Caption         =   "物资编号:"
  114.          Height          =   375
  115.          Left            =   360
  116.          TabIndex        =   13
  117.          Top             =   600
  118.          Width           =   1095
  119.       End
  120.    End
  121.    Begin VB.Frame Frame4 
  122.       Caption         =   "物资编号"
  123.       Height          =   1575
  124.       Left            =   4800
  125.       TabIndex        =   6
  126.       Top             =   120
  127.       Width           =   3495
  128.       Begin VB.CommandButton Command3 
  129.          Caption         =   "查询"
  130.          Height          =   375
  131.          Left            =   1080
  132.          TabIndex        =   11
  133.          Top             =   960
  134.          Width           =   1215
  135.       End
  136.       Begin VB.TextBox Text3 
  137.          Height          =   375
  138.          Left            =   720
  139.          TabIndex        =   7
  140.          Text            =   "001"
  141.          Top             =   360
  142.          Width           =   1575
  143.       End
  144.       Begin VB.Label Label1 
  145.          Caption         =   "(如 001)"
  146.          Height          =   375
  147.          Left            =   2400
  148.          TabIndex        =   9
  149.          Top             =   480
  150.          Width           =   975
  151.       End
  152.    End
  153.    Begin VB.Frame Frame2 
  154.       Caption         =   "Frame2"
  155.       Height          =   15
  156.       Left            =   480
  157.       TabIndex        =   5
  158.       Top             =   2040
  159.       Width           =   135
  160.    End
  161.    Begin VB.Frame Frame1 
  162.       Caption         =   "物资名"
  163.       Height          =   1575
  164.       Left            =   720
  165.       TabIndex        =   2
  166.       Top             =   120
  167.       Width           =   3255
  168.       Begin VB.CommandButton Command2 
  169.          Caption         =   "查询"
  170.          BeginProperty Font 
  171.             Name            =   "宋体"
  172.             Size            =   10.5
  173.             Charset         =   134
  174.             Weight          =   400
  175.             Underline       =   0   'False
  176.             Italic          =   0   'False
  177.             Strikethrough   =   0   'False
  178.          EndProperty
  179.          Height          =   375
  180.          Left            =   840
  181.          TabIndex        =   4
  182.          Top             =   960
  183.          Width           =   1215
  184.       End
  185.       Begin VB.TextBox Text2 
  186.          BeginProperty Font 
  187.             Name            =   "宋体"
  188.             Size            =   10.5
  189.             Charset         =   134
  190.             Weight          =   700
  191.             Underline       =   0   'False
  192.             Italic          =   0   'False
  193.             Strikethrough   =   0   'False
  194.          EndProperty
  195.          Height          =   375
  196.          Left            =   600
  197.          TabIndex        =   3
  198.          Text            =   "钢材"
  199.          Top             =   360
  200.          Width           =   1455
  201.       End
  202.       Begin VB.Label Label2 
  203.          Caption         =   "(如 钢材)"
  204.          Height          =   375
  205.          Left            =   2040
  206.          TabIndex        =   8
  207.          Top             =   480
  208.          Width           =   1095
  209.       End
  210.    End
  211.    Begin VB.CommandButton Command1 
  212.       Caption         =   "Command1"
  213.       Height          =   375
  214.       Left            =   960
  215.       TabIndex        =   1
  216.       Top             =   960
  217.       Width           =   1095
  218.    End
  219.    Begin VB.TextBox Text1 
  220.       Height          =   375
  221.       Left            =   1320
  222.       TabIndex        =   0
  223.       Text            =   "Text1"
  224.       Top             =   360
  225.       Width           =   1335
  226.    End
  227.    Begin VB.Label Label8 
  228.       Caption         =   "Label8"
  229.       Height          =   495
  230.       Left            =   3720
  231.       TabIndex        =   17
  232.       Top             =   2400
  233.       Width           =   1215
  234.    End
  235.    Begin VB.Label Label7 
  236.       Caption         =   "Label7"
  237.       Height          =   495
  238.       Left            =   3720
  239.       TabIndex        =   16
  240.       Top             =   2400
  241.       Width           =   1215
  242.    End
  243.    Begin VB.Label Label6 
  244.       Caption         =   "Label6"
  245.       Height          =   495
  246.       Left            =   3720
  247.       TabIndex        =   15
  248.       Top             =   2400
  249.       Width           =   1215
  250.    End
  251.    Begin VB.Label Label3 
  252.       Caption         =   "or"
  253.       BeginProperty Font 
  254.          Name            =   "宋体"
  255.          Size            =   21.75
  256.          Charset         =   134
  257.          Weight          =   400
  258.          Underline       =   0   'False
  259.          Italic          =   0   'False
  260.          Strikethrough   =   0   'False
  261.       EndProperty
  262.       Height          =   615
  263.       Left            =   4200
  264.       TabIndex        =   10
  265.       Top             =   600
  266.       Width           =   615
  267.    End
  268. End
  269. Attribute VB_Name = "Form4"
  270. Attribute VB_GlobalNameSpace = False
  271. Attribute VB_Creatable = False
  272. Attribute VB_PredeclaredId = True
  273. Attribute VB_Exposed = False
  274. Dim x As Single
  275. Dim y As Single
  276. Dim l As Single
  277. Dim m As Single
  278. Private Sub Command2_Click()
  279. Dim pubConn As New ADODB.Connection
  280. Dim rsTable As New ADODB.Recordset
  281. Dim rsTable1 As New ADODB.Recordset
  282. Dim rsTable2 As New ADODB.Recordset
  283. Dim strSQL As String
  284. If Text2.Text <> "" Then
  285. pubConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "runnerup.mdb" & ";" & "Persist Security Info=False"
  286. pubConn.ConnectionTimeout = 30
  287. pubConn.Open
  288. rsTable.CursorLocation = adUseClient
  289. strSQL = "select avg(数量),count(*) from input11 where 物资名称='" & Trim(Text2.Text) & "'"
  290. rsTable.Open strSQL, pubConn, adOpenDynamic, adLockOptimistic
  291. x = rsTable!expr1000
  292. y = rsTable!expr1001
  293. rsTable1.CursorLocation = adUseClient
  294. strSQL = "select avg(数量),count(*) from output11 where 物资名称='" & Trim(Text2.Text) & "'"
  295. rsTable1.Open strSQL, pubConn, adOpenDynamic, adLockOptimistic
  296. l = rsTable1!expr1000
  297. m = rsTable1!expr1001
  298. Text9.Text = x * y - l * m
  299. rsTable2.CursorLocation = adUseClient
  300. strSQL = "select * from input11 where 物资名称='" & Trim(Text2.Text) & "'"
  301. rsTable2.Open strSQL, pubConn, adOpenDynamic, adLockOptimistic
  302.     Text4.Text = rsTable2!物资编号
  303.     Text5.Text = rsTable2!物资名称
  304.     Text6.Text = rsTable2!单价
  305.     Text10.Text = rsTable2!金额
  306.     Text8.Text = rsTable2!计量单位
  307.     Else
  308.     m = MsgBox("错误,请重新登录", vbExclamation)
  309.     End If
  310. End Sub
  311. Private Sub Command3_Click()
  312. Dim pubConn As New ADODB.Connection
  313. Dim rsTable As New ADODB.Recordset
  314. Dim rsTable1 As New ADODB.Recordset
  315. Dim rsTable2 As New ADODB.Recordset
  316. Dim strSQL As String
  317. If Text3.Text <> "" Then
  318. pubConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "runnerup.mdb" & ";" & "Persist Security Info=False"
  319. pubConn.ConnectionTimeout = 30
  320. pubConn.Open
  321. rsTable.CursorLocation = adUseClient
  322. strSQL = "select avg(数量),count(*) from input11 where 物资编号='" & Trim(Text3.Text) & "'"
  323. rsTable.Open strSQL, pubConn, adOpenDynamic, adLockOptimistic
  324. x = rsTable!expr1000
  325. y = rsTable!expr1001
  326. rsTable1.CursorLocation = adUseClient
  327. strSQL = "select avg(数量),count(*) from output11 where 物资编号='" & Trim(Text3.Text) & "'"
  328. rsTable1.Open strSQL, pubConn, adOpenDynamic, adLockOptimistic
  329. l = rsTable1!expr1000
  330. m = rsTable1!expr1001
  331. Text9.Text = x * y - l * m
  332. rsTable2.CursorLocation = adUseClient
  333. strSQL = "select * from input11 where 物资编号='" & Trim(Text3.Text) & "'"
  334. rsTable2.Open strSQL, pubConn, adOpenDynamic, adLockOptimistic
  335.     Text4.Text = rsTable2!物资编号
  336.     Text5.Text = rsTable2!物资名称
  337.     Text6.Text = rsTable2!单价
  338.     Text10.Text = rsTable2!金额
  339.     Text8.Text = rsTable2!计量单位
  340.     Else
  341.     m = MsgBox("错误,请重新登录", vbExclamation)
  342.    End If
  343. End Sub
  344. Private Sub Command5_Click()
  345. Unload Me
  346. End Sub