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

📄 mainform.frm

📁 供销信息查询系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
               DataField       =   ""
               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 
               EndProperty
               BeginProperty Column01 
               EndProperty
            EndProperty
         End
         Begin MSAdodcLib.Adodc Adodc1 
            Height          =   380
            Left            =   120
            Top             =   3620
            Width           =   8195
            _ExtentX        =   14446
            _ExtentY        =   688
            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=   1
            Appearance      =   1
            BackColor       =   -2147483643
            ForeColor       =   -2147483640
            Orientation     =   0
            Enabled         =   -1
            Connect         =   ""
            OLEDBString     =   ""
            OLEDBFile       =   ""
            DataSourceName  =   ""
            OtherAttributes =   ""
            UserName        =   ""
            Password        =   ""
            RecordSource    =   ""
            Caption         =   "Adodc1"
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "宋体"
               Size            =   9
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            _Version        =   393216
         End
         Begin MSDataGridLib.DataGrid DataGrid1 
            Height          =   3100
            Left            =   120
            TabIndex        =   2
            Top             =   480
            Width           =   8195
            _ExtentX        =   14446
            _ExtentY        =   5477
            _Version        =   393216
            HeadLines       =   1
            RowHeight       =   15
            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
            ColumnCount     =   2
            BeginProperty Column00 
               DataField       =   ""
               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       =   ""
               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 
               EndProperty
               BeginProperty Column01 
               EndProperty
            EndProperty
         End
      End
   End
End
Attribute VB_Name = "mainform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private rs As New ADODB.Recordset
Private strconn As String
Private strsql As String
Private intcode As Integer
Private del1 As Integer

Private Sub Adodc1_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
Adodc1.Caption = "当前记录为:" & Adodc1.Recordset.AbsolutePosition & "/" & Adodc1.Recordset.RecordCount
End Sub

Private Sub Adodc2_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
Adodc2.Caption = "当前记录为:" & Adodc2.Recordset.AbsolutePosition & "/" & Adodc2.Recordset.RecordCount
End Sub

Private Sub Adodc3_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
Adodc3.Caption = "当前记录为:" & Adodc3.Recordset.AbsolutePosition & "/" & Adodc3.Recordset.RecordCount
End Sub

Private Sub Adodc4_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
Adodc4.Caption = "当前记录为:" & Adodc4.Recordset.AbsolutePosition & "/" & Adodc4.Recordset.RecordCount
End Sub

Private Sub Form_Activate()
'If loadform1 <> 1 Then
'   loadform.Show
'End If
'If xulang1 <> 1 Then
'   xulangForm.Show
'End If
mainmdiform.Toolbar1.Buttons(7).Enabled = True
If SSTab1.Tab = 0 Then
  strconn = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\供销信息.mdb"
  strsql = "select * from 厂家"
  With rs
    If .State = adStateOpen Then
       .Close
    End If
    .ActiveConnection = strconn
    .Source = strsql
    .LockType = adLockReadOnly
    .CursorLocation = adUseClient
    .CursorType = adOpenDynamic
    .Open
  End With
  Set DataGrid1.DataSource = rs
  Set Adodc1.Recordset = rs
  sst = 1
  lastid = (Adodc1.Recordset.RecordCount + 1)
  Adodc1.Caption = "当前记录为:" & Adodc1.Recordset.AbsolutePosition & "/" & Adodc1.Recordset.RecordCount
  With DataGrid1
    .Columns(0).Width = 1000
    .Columns(1).Width = 1300
    .Columns(2).Width = 2000
    .Columns(3).Width = 1000
    .Columns(4).Width = 1300
    .Columns(5).Width = 1200
  End With
End If
End Sub

Private Sub Form_Load()
mainform.Visible = False
SSTab1.Tab = 0
mainform1 = 1
add1 = 0
del1 = 0
var1 = -1
mainmdiform.file1.Checked = True
End Sub

Private Sub Form_Resize()
If mainform.WindowState = 0 Then
   mainform.WindowState = 2
End If
End Sub

Private Sub SSTab1_Click(PreviousTab As Integer)
On Error Resume Next
If SSTab1.Tab = 0 Then
  mainmdiform.file1.Checked = True
  mainmdiform.file2.Checked = False
  mainmdiform.file3.Checked = False
  mainmdiform.file4.Checked = False
  mainmdiform.StatusBar1.SimpleText = "正在查阅... ...厂家表"
  mainmdiform.Toolbar1.Buttons(7).Enabled = True
  strconn = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\供销信息.mdb"
  strsql = "select * from 厂家"
  With rs
    If .State = adStateOpen Then
       .Close
    End If
    .ActiveConnection = strconn
    .Source = strsql
    If che1 = 1 Then
    .LockType = adLockReadOnly
    Else
    .LockType = adLockOptimistic
    End If
    .CursorLocation = adUseClient
    .CursorType = adOpenDynamic
    .Open
  End With
  Set DataGrid1.DataSource = rs
  Set Adodc1.Recordset = rs
  sst = 1
  lastid = (Adodc1.Recordset.RecordCount + 1)
  Adodc1.Caption = "当前记录为:" & Adodc1.Recordset.AbsolutePosition & "/" & Adodc1.Recordset.RecordCount
  With DataGrid1
    .Columns(0).Width = 1000
    .Columns(1).Width = 1300
    .Columns(2).Width = 2000
    .Columns(3).Width = 1000
    .Columns(4).Width = 1300
    .Columns(5).Width = 1200
  End With
End If
If SSTab1.Tab = 1 Then
  mainmdiform.file1.Checked = False
  mainmdiform.file2.Checked = True
  mainmdiform.file3.Checked = False
  mainmdiform.file4.Checked = False
  mainmdiform.StatusBar1.SimpleText = "正在查阅... ...产品表"
  mainmdiform.Toolbar1.Buttons(7).Enabled = True
  strconn = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\供销信息.mdb"
  strsql = "select * from 产品"
  With rs
    If .State = adStateOpen Then
       .Close
    End If
    .ActiveConnection = strconn
    .Source = strsql
    If che1 = 1 Then
    .LockType = adLockReadOnly
    Else
    .LockType = adLockOptimistic
    End If
    .CursorLocation = adUseClient
    .CursorType = adOpenDynamic
    .Open
  End With
  Set DataGrid2.DataSource = rs
  Set Adodc2.Recordset = rs
  sst = 2
  lastid = (Adodc2.Recordset.RecordCount + 1)
  Adodc2.Caption = "当前记录为:" & Adodc2.Recordset.AbsolutePosition & "/" & Adodc2.Recordset.RecordCount
  With DataGrid2
    .Columns(0).Width = 1000
    .Columns(1).Width = 1300
    .Columns(2).Width = 2000
    .Columns(3).Width = 2000
    .Columns(4).Width = 1300
  End With
End If
If SSTab1.Tab = 2 Then
  mainmdiform.file1.Checked = False
  mainmdiform.file2.Checked = False
  mainmdiform.file3.Checked = True
  mainmdiform.file4.Checked = False
  mainmdiform.StatusBar1.SimpleText = "正在查阅... ...销售表"
  mainmdiform.Toolbar1.Buttons(7).Enabled = True
  strconn = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\供销信息.mdb"
  strsql = "select * from 销售"
  With rs
    If .State = adStateOpen Then
       .Close
    End If
    .ActiveConnection = strconn
    .Source = strsql
    If che1 = 1 Then
    .LockType = adLockReadOnly
    Else
    .LockType = adLockOptimistic
    End If
    .CursorLocation = adUseClient
    .CursorType = adOpenDynamic
    .Open
  End With
  Set DataGrid3.DataSource = rs
  Set Adodc3.Recordset = rs
  sst = 3
  lastid = (Adodc3.Recordset.RecordCount + 1)
  Adodc3.Caption = "当前记录为:" & Adodc3.Recordset.AbsolutePosition & "/" & Adodc3.Recordset.RecordCount
  With DataGrid3
    .Columns(0).Width = 800
    .Columns(1).Width = 800
    .Columns(2).Width = 900
    .Columns(3).Width = 1800
    .Columns(4).Width = 1300
    .Columns(5).Width = 1000
    .Columns(6).Width = 1000
  End With
End If
If SSTab1.Tab = 3 Then
  mainmdiform.file1.Checked = False
  mainmdiform.file2.Checked = False
  mainmdiform.file3.Checked = False
  mainmdiform.file4.Checked = True
  mainmdiform.StatusBar1.SimpleText = "正在查阅... ...商场表"
  mainmdiform.Toolbar1.Buttons(7).Enabled = False
  strconn = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\供销信息.mdb"
  strsql = "select * from 商场"
  With rs
    If .State = adStateOpen Then
       .Close
    End If
    .ActiveConnection = strconn
    .Source = strsql
    If che1 = 1 Then
    .LockType = adLockReadOnly
    Else
    .LockType = adLockOptimistic
    End If
    .CursorLocation = adUseClient
    .CursorType = adOpenDynamic
    .Open
  End With
  Set DataGrid4.DataSource = rs
  Set Adodc4.Recordset = rs
  sst = 4
  lastid = (Adodc4.Recordset.RecordCount + 1)
  Adodc4.Caption = "当前记录为:" & Adodc4.Recordset.AbsolutePosition & "/" & Adodc4.Recordset.RecordCount
  With DataGrid4
    .Columns(0).Width = 1000
    .Columns(1).Width = 1300
    .Columns(2).Width = 2000
    .Columns(3).Width = 1000
    .Columns(4).Width = 1300
    .Columns(5).Width = 1200
  End With
End If
End Sub

⌨️ 快捷键说明

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