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

📄 buyfind.frm

📁 这个是VB环境开发的,我也是转载的把原来的Access数据库改成了SQl Server数据库.希望大家可以借鉴
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Index           =   1
         Left            =   3480
         Picture         =   "BuyFind.frx":0442
         Top             =   480
         Width           =   480
      End
      Begin VB.Image Image1 
         Appearance      =   0  'Flat
         Height          =   480
         Index           =   2
         Left            =   3480
         Picture         =   "BuyFind.frx":0884
         Top             =   960
         Width           =   480
      End
      Begin VB.Image Image1 
         Appearance      =   0  'Flat
         Height          =   480
         Index           =   3
         Left            =   3480
         Picture         =   "BuyFind.frx":0CC6
         Top             =   1440
         Width           =   480
      End
      Begin VB.Label lbltype 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "产品名称:"
         Height          =   180
         Left            =   1440
         TabIndex        =   23
         Top             =   1320
         Visible         =   0   'False
         Width           =   900
      End
      Begin VB.Label lbltype1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "产品名称:"
         Height          =   180
         Left            =   4560
         TabIndex        =   22
         Top             =   1320
         Visible         =   0   'False
         Width           =   900
      End
   End
   Begin VB.PictureBox Picture1 
      BorderStyle     =   0  'None
      Height          =   495
      Left            =   0
      Picture         =   "BuyFind.frx":1108
      ScaleHeight     =   495
      ScaleWidth      =   8295
      TabIndex        =   3
      Top             =   0
      Width           =   8295
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "单 据 查 询"
         BeginProperty Font 
            Name            =   "隶书"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H0080C0FF&
         Height          =   300
         Left            =   480
         TabIndex        =   4
         Top             =   120
         Width           =   1770
      End
   End
   Begin VB.CommandButton CmdDelete 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "清 除"
      Height          =   375
      Left            =   2760
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   2520
      Width           =   975
   End
   Begin VB.CommandButton CmdCancel 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "退 出"
      Height          =   375
      Left            =   4440
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   2520
      Width           =   975
   End
   Begin VB.CommandButton CmdOk 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "确  定"
      Height          =   375
      Left            =   1080
      Picture         =   "BuyFind.frx":5068
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   2520
      Width           =   975
   End
End
Attribute VB_Name = "Frm_BuyFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub ck1_Click()
 If ck1.Value Then
       txtid.Enabled = True
       txt1id.Enabled = True
       txtid.SetFocus
    Else
       txtid.Enabled = False
       txt1id.Enabled = False
'       txtid = ""
'       txt1id = ""
    End If
End Sub

Private Sub ck2_Click()
  If ck2.Value Then
       dtp1.Enabled = True
       dtp2.Enabled = True
    Else
       dtp1.Enabled = False
       dtp2.Enabled = False
    End If
End Sub

Private Sub ck3_Click()
  If ck3.Value Then
       cmdE1.Enabled = True
       cmdE2.Enabled = True
       cmdE1.SetFocus
    Else
       cmdE1.Enabled = False
       cmdE2.Enabled = False
     End If
End Sub

Private Sub ck4_Click()
 If ck4.Value Then
      cmdcomp.Enabled = True
      cmdcomp1.Enabled = True
      cmdcomp.SetFocus
     Else
      cmdcomp.Enabled = False
      cmdcomp1.Enabled = False
     End If
End Sub

Private Sub CmdCancel_Click()
Unload Me
End Sub

Private Sub cmdcomp_Click()
    frmcompany.CmdInsert.Visible = True
    frmcompany.InsertType = "buyFind"
    frmcompany.Show 1
End Sub

Private Sub cmdcomp1_Click()
    frmcompany.CmdInsert.Visible = True
    frmcompany.InsertType = "buyFind"
    frmcompany.Show 1
End Sub

Private Sub CmdDelete_Click()
    txtid = "": txt1id = ""
    txtele = "": txtele1 = ""
    txtcomp = "": txtcomp1 = ""
End Sub

Private Sub cmdE1_Click()
 
        frmelement.CmdInsert.Visible = True
        frmelement.InsertType = "frmIFind"
        frmelement.Show 1
    
  
End Sub

Private Sub cmdE2_Click()
cmdE1_Click
End Sub

Private Sub CmdOk_Click()
Dim Str As String
Str = "select * from grdbuy1"
If ck1.Value And txt1id <> "" Then
   If Val(txtid) > Val(txt1id) Then
       MsgBox " 数据输入错误!  ", vbInformation, ginfo
       txt1id.SetFocus
       Exit Sub
   End If
   Str = Str & " where id>= " & Val(txtid) & " and id<=" & Val(txt1id) & ""
End If
 
   If ck2.Value Then
      If dtp1 < dtp2 Then
         If InStr(1, Str, "where") <> 0 Then
            Str = Str & " and buydate >= # " & Format(dtp1, "yyyy-mm-dd") & " # and  buydate<= # " & Format(dtp2, "yyyy-mm-dd") & " #"
         Else
            Str = Str & " where buydate >= # " & Format(dtp1, "yyyy-mm-dd") & " # and  buydate<= # " & Format(dtp2, "yyyy-mm-dd") & " #"
         End If
      Else
         MsgBox " 前边日期大于后边的日期! ", , ginfo
         Exit Sub
      End If
   End If
 
  If ck3.Value Then
     If InStr(1, Str, "where") <> 0 Then
        Str = Str & "  and ename in ('" & txtele & " ','" & txtele1 & "')"
     Else
        Str = Str & "  where ename in ('" & txtele & " ','" & txtele1 & "')"
     End If
     ' Str = Str & "  and etype in ('" & lbltype & "','" & lbltype1 & "')"
  End If
If ck4.Value Then
   If InStr(1, Str, "where") <> 0 Then
      Str = Str & " and compname in('" & txtcomp & " ','" & txtcomp1 & "')"
   Else
      Str = Str & " where compname in('" & txtcomp & " ','" & txtcomp1 & "')"
   End If
End If

    If frmIFind.Caption <> "入库统计" Then
        If RSF.State Then
           RSF.Close
           RSF.Open Str, cn, adOpenKeyset, adLockBatchOptimistic
        Else
           RSF.Open Str, cn, adOpenKeyset, adLockBatchOptimistic
        End If
        Set Frm_buysee.dtgrd1.DataSource = RSF
        Frm_buysee.Show 1
    Else
       Set RSF = Nothing
       RSF.CursorLocation = adUseClient
       RSF.Open Str, cn, adOpenStatic, adLockBatchOptimistic
       RSF.Requery
       Set frmcount.dtgrd1.DataSource = RSF
       frmcount.Show
    End If
End Sub

Private Sub Form_Load()
dtp2.Value = Date
End Sub

⌨️ 快捷键说明

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