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

📄 items.frm

📁 nice proggy nnnnnnnnnnnnnn
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form items 
   BackColor       =   &H008080FF&
   BorderStyle     =   0  'None
   Caption         =   "Form3"
   ClientHeight    =   4035
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   3225
   ControlBox      =   0   'False
   LinkTopic       =   "Form3"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4035
   ScaleWidth      =   3225
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton Command2 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   375
      Left            =   1920
      TabIndex        =   7
      Top             =   4080
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      DataField       =   "item_code"
      DataSource      =   "data3"
      Height          =   285
      Left            =   2640
      TabIndex        =   6
      Text            =   "Text1"
      Top             =   4560
      Width           =   150
   End
   Begin MSAdodcLib.Adodc data3 
      Height          =   330
      Left            =   2880
      Top             =   4200
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=relience"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "relience"
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from stock"
      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.ComboBox Combo2 
      Height          =   315
      Left            =   1200
      TabIndex        =   1
      Text            =   "Combo2"
      Top             =   480
      Width           =   1935
   End
   Begin VB.ComboBox Combo1 
      Height          =   315
      Left            =   1200
      TabIndex        =   0
      Text            =   "Combo1"
      Top             =   120
      Width           =   1935
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Default         =   -1  'True
      Height          =   375
      Left            =   0
      TabIndex        =   4
      Top             =   4080
      Width           =   1815
   End
   Begin VB.ListBox List1 
      Height          =   2985
      Left            =   75
      TabIndex        =   2
      Top             =   960
      Width           =   3075
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "Item"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   60
      TabIndex        =   5
      Top             =   480
      Width           =   1095
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "Group Head"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   60
      TabIndex        =   3
      Top             =   120
      Width           =   1095
   End
End
Attribute VB_Name = "items"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
Combo2.Clear
data3.RecordSource = "select distinct item from stock where g_head like '" + Trim(Combo1.Text) + "%'"
data3.Refresh
While data3.Recordset.EOF = False
    Combo2.AddItem data3.Recordset.Fields(0)
    data3.Recordset.MoveNext
Wend
End Sub

Private Sub Combo2_Click()
List1.Clear
data3.RecordSource = "select distinct model from stock where g_head = '" + Combo1.Text + "' and item = '" + Combo2.Text + "'"
data3.Refresh
While data3.Recordset.EOF = False
    List1.AddItem data3.Recordset.Fields(0)
    data3.Recordset.MoveNext
Wend
List1.ListIndex = 0
End Sub

Private Sub Command1_Click()
'If Me.Tag = "" Then
'        If Trim(Combo1.Text) <> "" Then
'        data3.RecordSource = "select * from stock where g_head = '" + Combo1.Text + "' and item = '" + Combo2.Text + "' and model = '" + List1.Text + "'"
'        data3.Refresh
'        Form2.Tag = data3.Recordset.Fields("QOH")
'
'        Form2.Text4 = data3.Recordset.Fields("item_code")
'        Form2.Text5 = data3.Recordset.Fields("g_head")
'        Form2.Text6 = data3.Recordset.Fields("item")
'        Form2.Text7 = data3.Recordset.Fields("model")
'        Form2.Text9 = data3.Recordset.Fields("price")
'
'        Form2.Label8 = "Max:" + Str(data3.Recordset.Fields("QOH"))
'
'        Form2.Enabled = True
'        Form2.Show
'        Unload Me
'        Else
'        Form2.Enabled = True
'        Form2.Show
'        Unload Me
'        End If
'End If

If Me.Tag = "purcg" Then
        If Trim(Combo1.Text) <> "" Then
        data3.RecordSource = "select * from stock where g_head = '" + Combo1.Text + "' and item = '" + Combo2.Text + "' and model = '" + List1.Text + "'"
        data3.Refresh
        purcg.Tag = data3.Recordset.Fields("QOH")
        
        purcg.Text4 = data3.Recordset.Fields("item_code")
        purcg.Text14 = data3.Recordset.Fields("g_head")
        purcg.Text5 = data3.Recordset.Fields("item")
        purcg.Text6 = data3.Recordset.Fields("model")
        purcg.Text7 = data3.Recordset.Fields("Price")
        purcg.Text10 = data3.Recordset.Fields("Price")
        
        purcg.Label8 = "QOH:" + Str(data3.Recordset.Fields("QOH"))
        purcg.Tag = "called"
        purcg.Enabled = True
        purcg.Show
        Unload Me
        Else
        purcg.Enabled = True
        purcg.Show
        Unload Me
        End If
End If

If Me.Tag = "saleg" Then
        If Trim(Combo1.Text) <> "" Then
        data3.RecordSource = "select * from stock where g_head = '" + Combo1.Text + "' and item = '" + Combo2.Text + "' and model = '" + List1.Text + "'"
        data3.Refresh
        saleg.Tag = data3.Recordset.Fields("QOH")
        
        saleg.Text4 = data3.Recordset.Fields("item_code")
        saleg.Text14 = data3.Recordset.Fields("g_head")
        saleg.Text5 = data3.Recordset.Fields("item")
        saleg.Text6 = data3.Recordset.Fields("model")
        saleg.Text7 = data3.Recordset.Fields("Price")
        saleg.Text10 = data3.Recordset.Fields("Price")
        
        saleg.Label8 = "QOH:" + Str(data3.Recordset.Fields("QOH"))
        saleg.Tag = "called"
        saleg.Enabled = True
        saleg.Show
        Unload Me
        Else
        saleg.Enabled = True
        saleg.Show
        Unload Me
        End If
End If
End Sub

Private Sub Command2_Click()
If Me.Tag = "" Then
        Form2.Tag = "cancel"
        Form2.Enabled = True
        Form2.Show
        Unload Me
End If

If Me.Tag = "P" Then
        Purchase.Tag = "cancel"
        Purchase.Enabled = True
        Purchase.Show
        Unload Me
End If

End Sub

Private Sub Form_Activate()
If data3.Recordset.RecordCount <> 0 Then
data3.Recordset.MoveFirst
data3.RecordSource = "select distinct g_head from stock"
data3.Refresh
Combo1.Clear
While data3.Recordset.EOF = False
    Combo1.AddItem data3.Recordset.Fields(0)
    data3.Recordset.MoveNext
Wend
End If
Combo1.SetFocus
End Sub

⌨️ 快捷键说明

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