www.pudn.com > Pepsi_five.rar > FrmPsSql.frm


VERSION 5.00 
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX" 
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX" 
Begin VB.Form FrmPsSql  
   Caption         =   "采购入库单查询(已过帐)" 
   ClientHeight    =   6900 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   7725 
   Icon            =   "FrmPsSql.frx":0000 
   LinkTopic       =   "Form1" 
   MDIChild        =   -1  'True 
   ScaleHeight     =   6900 
   ScaleWidth      =   7725 
   Begin VB.Frame Frame2  
      ForeColor       =   &H00000000& 
      Height          =   3900 
      Left            =   0 
      TabIndex        =   5 
      Top             =   2940 
      Width           =   7695 
      Begin MSDataGridLib.DataGrid DataGrid2  
         Bindings        =   "FrmPsSql.frx":0442 
         Height          =   2055 
         Left            =   420 
         TabIndex        =   18 
         Top             =   1260 
         Width           =   6855 
         _ExtentX        =   12091 
         _ExtentY        =   3625 
         _Version        =   393216 
         AllowUpdate     =   0   'False 
         Enabled         =   -1  'True 
         HeadLines       =   1 
         RowHeight       =   17 
         FormatLocked    =   -1  'True 
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         DataMember      =   "ComOrdDB" 
         ColumnCount     =   5 
         BeginProperty Column00  
            DataField       =   "order_id" 
            Caption         =   "order_id" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   0 
               Format          =   "" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         BeginProperty Column01  
            DataField       =   "p_id" 
            Caption         =   "物品编号" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   0 
               Format          =   "" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         BeginProperty Column02  
            DataField       =   "qty" 
            Caption         =   "数量" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   1 
               Format          =   "#,##0.0000" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         BeginProperty Column03  
            DataField       =   "unit_price" 
            Caption         =   "单价" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   1 
               Format          =   "0.00" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         BeginProperty Column04  
            DataField       =   "price" 
            Caption         =   "金额" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   1 
               Format          =   "#,##0.00" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         SplitCount      =   1 
         BeginProperty Split0  
            BeginProperty Column00  
               ColumnAllowSizing=   0   'False 
               Object.Visible         =   0   'False 
               ColumnWidth     =   1275.024 
            EndProperty 
            BeginProperty Column01  
               Alignment       =   1 
               ColumnAllowSizing=   0   'False 
               ColumnWidth     =   1184.882 
            EndProperty 
            BeginProperty Column02  
               Alignment       =   1 
               ColumnAllowSizing=   0   'False 
               ColumnWidth     =   1800 
            EndProperty 
            BeginProperty Column03  
               Alignment       =   1 
               ColumnAllowSizing=   0   'False 
               ColumnWidth     =   1500.095 
            EndProperty 
            BeginProperty Column04  
               Alignment       =   1 
               ColumnAllowSizing=   0   'False 
               ColumnWidth     =   1800 
            EndProperty 
         EndProperty 
      End 
      Begin MSDataListLib.DataCombo DCboSup  
         Bindings        =   "FrmPsSql.frx":0456 
         DataField       =   "ps_rid" 
         DataMember      =   "ComPsHB" 
         DataSource      =   "DEjxc" 
         Height          =   330 
         Left            =   5460 
         TabIndex        =   17 
         Top             =   300 
         Width           =   2055 
         _ExtentX        =   3625 
         _ExtentY        =   582 
         _Version        =   393216 
         Enabled         =   0   'False 
         MatchEntry      =   -1  'True 
         ListField       =   "supplier_name" 
         BoundColumn     =   "supplier_id" 
         Text            =   "" 
         Object.DataMember      =   "ComSupplier" 
      End 
      Begin VB.TextBox txtps_demo  
         DataField       =   "ps_demo" 
         DataMember      =   "ComPsHB" 
         DataSource      =   "DEjxc" 
         Enabled         =   0   'False 
         Height          =   330 
         Left            =   4560 
         TabIndex        =   16 
         Top             =   780 
         Width           =   2955 
      End 
      Begin VB.TextBox txtps_car  
         DataField       =   "ps_car" 
         DataMember      =   "ComPsHB" 
         DataSource      =   "DEjxc" 
         Enabled         =   0   'False 
         Height          =   330 
         Left            =   2760 
         TabIndex        =   14 
         Top             =   780 
         Width           =   1020 
      End 
      Begin VB.TextBox txtps_maker  
         DataField       =   "ps_maker" 
         DataMember      =   "ComPsHB" 
         DataSource      =   "DEjxc" 
         Enabled         =   0   'False 
         Height          =   330 
         Left            =   1200 
         TabIndex        =   12 
         Top             =   780 
         Width           =   765 
      End 
      Begin VB.TextBox txtps_date  
         DataField       =   "ps_date" 
         DataMember      =   "ComPsHB" 
         DataSource      =   "DEjxc" 
         Enabled         =   0   'False 
         Height          =   330 
         Left            =   3000 
         TabIndex        =   9 
         Top             =   285 
         Width           =   1080 
      End 
      Begin VB.TextBox txtps_id  
         DataField       =   "ps_id" 
         DataMember      =   "ComPsHB" 
         DataSource      =   "DEjxc" 
         Enabled         =   0   'False 
         Height          =   330 
         Left            =   1200 
         TabIndex        =   7 
         Top             =   285 
         Width           =   915 
      End 
      Begin VB.Label LblStatus  
         BorderStyle     =   1  'Fixed Single 
         ForeColor       =   &H00FF0000& 
         Height          =   255 
         Left            =   420 
         TabIndex        =   19 
         Top             =   3480 
         Width           =   6855 
      End 
      Begin VB.Label lblFieldLabel  
         Alignment       =   1  'Right Justify 
         AutoSize        =   -1  'True 
         Caption         =   "备注:" 
         Height          =   180 
         Index           =   7 
         Left            =   4080 
         TabIndex        =   15 
         Top             =   885 
         Width           =   450 
      End 
      Begin VB.Label lblFieldLabel  
         Alignment       =   1  'Right Justify 
         AutoSize        =   -1  'True 
         Caption         =   "车号:" 
         Height          =   180 
         Index           =   6 
         Left            =   2280 
         TabIndex        =   13 
         Top             =   870 
         Width           =   450 
      End 
      Begin VB.Label lblFieldLabel  
         Alignment       =   1  'Right Justify 
         AutoSize        =   -1  'True 
         Caption         =   "制单人:" 
         Height          =   180 
         Index           =   4 
         Left            =   540 
         TabIndex        =   11 
         Top             =   885 
         Width           =   630 
      End 
      Begin VB.Label lblFieldLabel  
         Alignment       =   1  'Right Justify 
         AutoSize        =   -1  'True 
         Caption         =   "对方单位:" 
         Height          =   180 
         Index           =   3 
         Left            =   4560 
         TabIndex        =   10 
         Top             =   330 
         Width           =   810 
      End 
      Begin VB.Label lblFieldLabel  
         Alignment       =   1  'Right Justify 
         AutoSize        =   -1  'True 
         Caption         =   "日期:" 
         Height          =   180 
         Index           =   1 
         Left            =   2520 
         TabIndex        =   8 
         Top             =   405 
         Width           =   450 
      End 
      Begin VB.Label lblFieldLabel  
         Alignment       =   1  'Right Justify 
         AutoSize        =   -1  'True 
         Caption         =   "单据编号:" 
         Height          =   180 
         Index           =   0 
         Left            =   360 
         TabIndex        =   6 
         Top             =   390 
         Width           =   810 
      End 
   End 
   Begin VB.Frame Frame1  
      Height          =   2955 
      Left            =   0 
      TabIndex        =   0 
      Top             =   -60 
      Width           =   7695 
      Begin VB.CommandButton CmdDep  
         Caption         =   "退出(&X)" 
         Height          =   315 
         Index           =   2 
         Left            =   6180 
         TabIndex        =   4 
         Top             =   2280 
         Width           =   1275 
      End 
      Begin VB.CommandButton CmdDep  
         Caption         =   "列表(&P)" 
         Height          =   315 
         Index           =   1 
         Left            =   6180 
         TabIndex        =   3 
         Top             =   1335 
         Width           =   1275 
      End 
      Begin VB.CommandButton CmdDep  
         Caption         =   "查询(&F)" 
         Height          =   315 
         Index           =   0 
         Left            =   6180 
         TabIndex        =   2 
         Top             =   420 
         Width           =   1275 
      End 
      Begin MSDataGridLib.DataGrid DataGrid1  
         Bindings        =   "FrmPsSql.frx":0472 
         Height          =   2655 
         Left            =   60 
         TabIndex        =   1 
         Top             =   180 
         Width           =   5895 
         _ExtentX        =   10398 
         _ExtentY        =   4683 
         _Version        =   393216 
         AllowUpdate     =   0   'False 
         AllowArrows     =   -1  'True 
         HeadLines       =   1 
         RowHeight       =   15 
         TabAcrossSplits =   -1  'True 
         TabAction       =   2 
         WrapCellPointer =   -1  'True 
         FormatLocked    =   -1  'True 
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         DataMember      =   "ComPsHB" 
         ColumnCount     =   6 
         BeginProperty Column00  
            DataField       =   "ps_id" 
            Caption         =   "单据编号" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   0 
               Format          =   "" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         BeginProperty Column01  
            DataField       =   "ps_date" 
            Caption         =   "日期" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   0 
               Format          =   "" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         BeginProperty Column02  
            DataField       =   "ps_rid" 
            Caption         =   "对方单位" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   0 
               Format          =   "" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         BeginProperty Column03  
            DataField       =   "ps_maker" 
            Caption         =   "制单人" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   0 
               Format          =   "" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         BeginProperty Column04  
            DataField       =   "ps_car" 
            Caption         =   "车号" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   0 
               Format          =   "" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         BeginProperty Column05  
            DataField       =   "ps_demo" 
            Caption         =   "备注" 
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}  
               Type            =   0 
               Format          =   "" 
               HaveTrueFalseNull=   0 
               FirstDayOfWeek  =   0 
               FirstWeekOfYear =   0 
               LCID            =   2052 
               SubFormatType   =   0 
            EndProperty 
         EndProperty 
         SplitCount      =   1 
         BeginProperty Split0  
            BeginProperty Column00  
               ColumnAllowSizing=   0   'False 
               ColumnWidth     =   854.929 
            EndProperty 
            BeginProperty Column01  
               ColumnAllowSizing=   0   'False 
               ColumnWidth     =   900.284 
            EndProperty 
            BeginProperty Column02  
               ColumnAllowSizing=   0   'False 
               ColumnWidth     =   794.835 
            EndProperty 
            BeginProperty Column03  
               ColumnAllowSizing=   0   'False 
               ColumnWidth     =   599.811 
            EndProperty 
            BeginProperty Column04  
               ColumnAllowSizing=   0   'False 
               ColumnWidth     =   900.284 
            EndProperty 
            BeginProperty Column05  
               ColumnAllowSizing=   0   'False 
               ColumnWidth     =   1500.095 
            EndProperty 
         EndProperty 
      End 
   End 
End 
Attribute VB_Name = "FrmPsSql" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
Private rsPsHB As ADODB.Recordset 
Private rsOrdDB As ADODB.Recordset 
Private cmPsHB As ADODB.Command 
Private strMaxNum As String 
 
Private Sub CmdDep_Click(Index As Integer) 
    Dim intAnswer As Integer 
    Dim strSQL As String 
    Select Case Index 
        Case 0 
            FrmSql.intNumField = 6 
            FrmSql.Show vbModal 
            Select Case FrmSql.intNumField 
                Case -1 
                    rsPsHB.Filter = Me.DataGrid1.Columns.Item(0).DataField & _ 
                    "<>''" 
                    rsOrdDB.Filter = "order_id ='" & Me.txtps_id.Text & "'" 
                Case -2 
                Case Else 
                    rsPsHB.Filter = Me.DataGrid1.Columns.Item(FrmSql.intNumField).DataField & _ 
                    " like '*" & FrmSql.strSqlField & "*'" 
                    rsOrdDB.Filter = "order_id ='" & Me.txtps_id.Text & "'" 
            End Select 
        Case 1 
             
        Case 2 
            Unload Me 
    End Select 
End Sub 
 
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer) 
    rsOrdDB.Filter = "order_id ='" & Me.txtps_id.Text & "'" 
End Sub 
 
Private Sub DataGrid2_RowColChange(LastRow As Variant, ByVal LastCol As Integer) 
    If CmdDep(0).Enabled = True Then 
        LblStatus.Caption = Product_Status(DataGrid2.Columns(1).Text) 
    End If 
End Sub 
 
Private Sub Form_Load() 
    intNumWindows = OpenWindow(intNumWindows) 
    Me.Height = 7305 
    Me.Width = 7845 
    Call SetFormStu(Me, frmMain) 
    Set rsPsHB = DEjxc.rsComPsHB 
    Set rsOrdDB = DEjxc.rsComOrdDB 
    Set cmPsHB = New ADODB.Command 
    cmPsHB.ActiveConnection = DEjxc.Conjxc 
    cmPsHB.CommandType = adCmdText 
    rsOrdDB.Filter = "order_id ='" & Me.txtps_id.Text & "'" 
End Sub 
 
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) 
    If CmdDep(2).Enabled = False Then 
        MsgBox "请先退出编辑状态后再退出该程序!", , "提示" 
        Cancel = True 
    End If 
End Sub 
 
Private Sub Form_Unload(Cancel As Integer) 
    intNumWindows = Closewindow(intNumWindows) 
    rsPsHB.Close 
    rsOrdDB.Close 
    Set rsPsHB = Nothing 
    Set rsOrdDB = Nothing 
    Set cmPsHB = Nothing 
End Sub