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

📄 frmincx.frm

📁 以前写的一个销售的管理系统,是牙刷销存管理系统,有销售,进货等功能,刚学VB时写的
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   5160
      TabIndex        =   11
      Top             =   480
      Width           =   1695
   End
   Begin VB.Label Label2 
      BackColor       =   &H8000000B&
      Caption         =   "查询开始日期:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   375
      Left            =   1560
      TabIndex        =   10
      Top             =   480
      Width           =   1695
   End
End
Attribute VB_Name = "frmincx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
  On Error GoTo a
  DefaultType = dbUseODBC
  Dim db As Database
  Dim wk As Workspace
  Dim sql As String
  Dim str As String
  Dim str1 As String
  Dim str2 As String
  str = "rdk" & seekyearin.Combo1.Text
  Set wk = DBEngine.Workspaces(0)
  Set db = OpenDatabase("xsys", dbDriverNoPrompt, False, "odbc;database=glxt;uid=;pwd=;dsn=xsys")
  wk.BeginTrans
  If comfirmonth.Text = "" Or comfirday.Text = "" Or comendmonth.Text = "" Or comendday.Text = "" Then
     MsgBox "起止日期不能为空,请填写日期!"
     Command2.SetFocus
  Else
     If txtid = "" Then
        sql = "select * from " + str + " "
        str1 = "where [入库日期]>=cdate('" + seekyearin.Combo1.Text & " - " & comfirmonth.Text & " - " & comfirday.Text + "')"
        str2 = " and [入库日期]<=cdate('" + seekyearin.Combo1.Text & " - " & comendmonth.Text & " - " & comendday.Text + " ')"
        Data1.RecordSource = sql & str1 & str2
        Data1.Refresh
     Else
        sql = "select * from " + str + " where 产品编号='" + txtid.Text + "'"
        str1 = " and [入库日期]>=cdate('" + seekyearin.Combo1.Text & " - " & comfirmonth.Text & " - " & comfirday.Text + "')"
        str2 = " and [入库日期]<=cdate('" + seekyearin.Combo1.Text & " - " & comendmonth.Text & " - " & comendday.Text + " ')"
        Data1.RecordSource = sql & str1 & str2
        Data1.Refresh
     End If
 End If
  wk.CommitTrans
  db.Close
a:
  If Err.Number = 3146 Then
     MsgBox "起止日期有误,请重新输入!"
  End If
End Sub

Private Sub Command2_Click()
  Unload Me
  frmmenu.Show
End Sub

Private Sub Command3_Click()
  On Error GoTo a
  DefaultType = dbUseODBC
  Dim db As Database
  Dim rs1 As Recordset
  Dim wk As Workspace
  Dim sql As String
  Dim str As String
  Dim str1 As String
  Dim str2 As String
  str = "rdk" & seekyearin.Combo1.Text
  Set wk = DBEngine.Workspaces(0)
  Set db = OpenDatabase("xsys", dbDriverNoPrompt, False, "odbc;database=glxt;uid=;pwd=;dsn=xsys")
  wk.BeginTrans
  If comfirmonth.Text = "" Or comfirday.Text = "" Or comendmonth.Text = "" Or comendday.Text = "" Then
     MsgBox "起止日期不能为空,请填写日期!"
     Command2.SetFocus
  Else
     If txtid = "" Then
        CommonDialog1.ShowPrinter
        Printer.Orientation = vbPRORPortrait
        Printer.PaperSize = vbPRPSA4
        Printer.ScaleMode = vbMillimeters
        Printer.FontName = "宋体"
        Printer.FontSize = 18
        sql = "select * from " + str + " "
        str1 = "where [入库日期]>=cdate('" + seekyearin.Combo1.Text & " - " & comfirmonth.Text & " - " & comfirday.Text + "')"
        str2 = " and [入库日期]<=cdate('" + seekyearin.Combo1.Text & " - " & comendmonth.Text & " - " & comendday.Text + " ')"
        sql = sql & str1 & str2
        Set rs1 = db.OpenRecordset(sql, dbOpenDynaset, dbwrite, dbOptimistic)
        rs1.MoveFirst
        Printer.CurrentX = 60
    Printer.CurrentY = 15
    Printer.Print "扬州市兴盛牙刷厂入库单"
    Printer.Line (50, 22)-(140, 22)
    Printer.Line (50, 23)-(140, 23)
    rs1.MoveFirst
    Printer.FontSize = 10
    Printer.CurrentX = 29.5
  Printer.CurrentY = 41.5
  Printer.Line (29.5, 41.5)-(150, 41.5)
  Printer.CurrentX = 29
  Printer.CurrentY = 42
  Printer.Line (30, 42)-(30, 47)
  Printer.CurrentX = 31
  Printer.CurrentY = 42
  Printer.Print "  产品型号"
  Printer.CurrentX = 55
  Printer.CurrentY = 42
     Printer.Line (56, 42)-(56, 47)
     Printer.CurrentX = 62
     Printer.CurrentY = 42
     Printer.Print "  数   量(箱)"
     Printer.CurrentX = 91
     Printer.CurrentY = 42
     Printer.Line (92, 42)-(92, 47)
     Printer.CurrentX = 93
     Printer.CurrentY = 42
     Printer.Print "  入库日期"
     Printer.CurrentX = 120
     Printer.CurrentY = 42
     Printer.Line (120, 42)-(120, 47)
     Printer.CurrentX = 121
     Printer.CurrentY = 42
     Printer.Print "  操作员"
     
     
     
     Printer.CurrentX = 150
     Printer.CurrentY = 42
     Printer.Line (150, 42)-(150, 47)
     Printer.Line (30, 47)-(150, 47)
     CurrentY = 47
     Do While rs1.EOF <> True
1         Printer.FontSize = 10
          CurrentX = 29.75
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          CurrentX = CurrentX + 1
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("产品编号")
          CurrentX = CurrentX + 25
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          CurrentX = CurrentX + 1
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("数量")
          CurrentX = CurrentX + 35
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          CurrentX = CurrentX + 1
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("入库日期")
          CurrentX = CurrentX + 27
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          Printer.CurrentX = CurrentX + 2
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("操作员")
          CurrentX = CurrentX + 30
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          Printer.Line (30, CurrentY + 5)-(150, CurrentY + 5)
          CurrentY = CurrentY + 5
          rs1.MoveNext
          If CurrentY >= 250 Then
             Printer.NewPage
             CurrentY = 15
             Printer.Line (30, CurrentY)-(150, CurrentY)
             GoTo 1
          End If
          If rs1.EOF = True Then
             Exit Do
          End If
     Loop
     Printer.EndDoc
    rs1.Close
        
     Else
        CommonDialog1.ShowPrinter
        Printer.Orientation = vbPRORPortrait
        Printer.PaperSize = vbPRPSA4
        Printer.ScaleMode = vbMillimeters
        Printer.FontName = "宋体"
        Printer.FontSize = 18
        sql = "select * from " + str + ""
        str1 = " where 产品编号='" + txtid.Text + "' and [入库日期]>=cdate('" + seekyearin.Combo1.Text & " - " & comfirmonth.Text & " - " & comfirday.Text + "')"
        str2 = " and [入库日期]<=cdate('" + seekyearin.Combo1.Text & " - " & comendmonth.Text & " - " & comendday.Text + " ')"
        sql = sql & str1 & str2
        Set rs1 = db.OpenRecordset(sql, dbOpenDynaset, dbwrite, dbOptimistic)
        Printer.CurrentX = 60
    Printer.CurrentY = 15
    Printer.Print "扬州市兴盛牙刷厂入库单"
    Printer.Line (50, 22)-(140, 22)
    Printer.Line (50, 23)-(140, 23)
    rs1.MoveFirst
    Printer.FontSize = 10
    Printer.CurrentX = 29.5
  Printer.CurrentY = 41.5
  Printer.Line (29.5, 41.5)-(150, 41.5)
  Printer.CurrentX = 29
  Printer.CurrentY = 42
  Printer.Line (30, 42)-(30, 47)
  Printer.CurrentX = 31
  Printer.CurrentY = 42
  Printer.Print "  产品型号"
  Printer.CurrentX = 55
  Printer.CurrentY = 42
     Printer.Line (56, 42)-(56, 47)
     Printer.CurrentX = 62
     Printer.CurrentY = 42
     Printer.Print "  数   量(箱)"
     Printer.CurrentX = 91
     Printer.CurrentY = 42
     Printer.Line (92, 42)-(92, 47)
     Printer.CurrentX = 93
     Printer.CurrentY = 42
     Printer.Print "  入库日期"
     Printer.CurrentX = 120
     Printer.CurrentY = 42
     Printer.Line (120, 42)-(120, 47)
     Printer.CurrentX = 121
     Printer.CurrentY = 42
     Printer.Print "  操作员"
     
     
     
     Printer.CurrentX = 150
     Printer.CurrentY = 42
     Printer.Line (150, 42)-(150, 47)
     Printer.Line (30, 47)-(150, 47)
     CurrentY = 47
     Do While rs1.EOF <> True
2         Printer.FontSize = 10
          CurrentX = 29.75
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          CurrentX = CurrentX + 1
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("产品编号")
          CurrentX = CurrentX + 25
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          CurrentX = CurrentX + 1
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("数量")
          CurrentX = CurrentX + 35
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          CurrentX = CurrentX + 1
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("入库日期")
          CurrentX = CurrentX + 27
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          Printer.CurrentX = CurrentX + 2
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("操作员")
          CurrentX = CurrentX + 30
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          Printer.Line (30, CurrentY + 5)-(150, CurrentY + 5)
          CurrentY = CurrentY + 5
          rs1.MoveNext
          If CurrentY >= 250 Then
             Printer.NewPage
             CurrentY = 15
             Printer.Line (30, CurrentY)-(150, CurrentY)
             GoTo 2
          End If
          If rs1.EOF = True Then
             Exit Do
          End If
     Loop
     Printer.EndDoc
    rs1.Close
     End If
 End If
  wk.CommitTrans
  db.Close
a:
  If Err.Number = 3146 Then
     MsgBox "起止日期有误,请重新输入!"
  End If
End Sub

⌨️ 快捷键说明

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