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

📄 frmoutcx.frm

📁 以前写的一个销售的管理系统,是牙刷销存管理系统,有销售,进货等功能,刚学VB时写的
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   7920
      TabIndex        =   12
      Top             =   480
      Width           =   255
   End
   Begin VB.Label Label8 
      Caption         =   "日"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   8760
      TabIndex        =   11
      Top             =   480
      Width           =   255
   End
End
Attribute VB_Name = "frmoutcx"
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
  Dim str3 As String
  Dim str4 As String
  str = "fdk" & seekyearout.Combo1.Text
  Set wk = DBEngine.Workspaces(0)
  Set db = OpenDatabase("xsys", dbDriverNoPrompt, False, "odbc;database=glxt;uid=;pwd=;dsn=xsys")
  If comfirmonth.Text = "" Or comfirday.Text = "" Or comendmonth.Text = "" Or comendday.Text = "" Then
     MsgBox "起止日期不能为空,请填写日期!"
     Command2.SetFocus
  Else
     If txtid = "" Then
        str1 = "select 发货单编号,产品编号,单价,数量,总金额,发货单日期"
        str2 = " from [" + str + "] where "
        str3 = " [发货单日期]>=cdate('" + seekyearout.Combo1.Text & " - " & comfirmonth.Text & " - " & comfirday.Text + "')"
        str4 = " and [发货单日期]<=cdate('" + seekyearout.Combo1.Text & " - " & comendmonth.Text & " - " & comendday.Text + " ')"
        sql = str1 + str2 + str3 + str4
        Data1.RecordSource = sql
        Data1.Refresh
     Else
        str1 = "select 发货单编号,产品编号,单价,数量,总金额,发货单日期"
        str2 = " from [" + str + "] where 客户编号='" + txtid.Text + "'"
        str3 = " and [发货单日期]>=cdate('" + seekyearout.Combo1.Text & " - " & comfirmonth.Text & " - " & comfirday.Text + "')"
        str4 = " and [发货单日期]<=cdate('" + seekyearout.Combo1.Text & " - " & comendmonth.Text & " - " & comendday.Text + "')"
        sql = str1 + str2 + str3 + str4
        Data1.RecordSource = sql
        Data1.Refresh
     End If
  End If
  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()
  DefaultType = dbUseODBC
  Dim db As Database
  Dim rs1 As Recordset
  Dim wk As Workspace
  Dim sql As String
  Dim str As String
  Dim yue As String
  Dim ri As String
  Dim str1 As String
  Dim str2 As String
  Dim str3 As String
  Dim str4 As String
  Dim zje As Currency
  zje = 0
  Dim zsl As Long
  zsl = 0
  str = "fdk" & seekyearout.Combo1.Text
  Set wk = DBEngine.Workspaces(0)
  Set db = OpenDatabase("xsys", dbDriverNoPrompt, False, "odbc;database=glxt;uid=;pwd=;dsn=xsys")
  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
        str1 = "select 发货单编号,产品编号,规格,单位,单价,数量,总金额,备注,发货单日期"
        str2 = " from [" + str + "] where"
        str3 = " [发货单日期]>=cdate('" + seekyearout.Combo1.Text & " - " & comfirmonth.Text & " - " & comfirday.Text + "')"
        str4 = " and [发货单日期]<=cdate('" + seekyearout.Combo1.Text & " - " & comendmonth.Text & " - " & comendday.Text + " ')"
        sql = str1 + str2 + str3 + str4
        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.CurrentX = 12
        Printer.CurrentY = 35
        Printer.FontSize = 10
        Printer.Print "客户名称:"
        Printer.CurrentX = 120
        Printer.CurrentY = 35
        Printer.Print seekyearout.Combo1.Text & "年" & comfirmonth.Text & "月" & comfirday.Text & "日" & "----" & seekyearout.Combo1.Text & "年" & comendmonth.Text & "月" & comendday.Text & "日"
        Printer.CurrentX = 5.5
        Printer.CurrentY = 31
        Printer.Line (6, 41.5)-(186, 41.5)
        Printer.CurrentX = 5
        Printer.CurrentY = 42
        Printer.Line (6, 42)-(6, 47)
        Printer.CurrentX = 7
        Printer.CurrentY = 42
        Printer.Print "发货单编号"
        Printer.CurrentX = 40
        Printer.CurrentY = 42
        Printer.Line (41, 42)-(41, 47)
        Printer.CurrentX = 42
        Printer.CurrentY = 42
        Printer.Print "  产品型号"
        Printer.CurrentX = 65
        Printer.CurrentY = 42
        Printer.Line (66, 42)-(66, 47)
        Printer.CurrentX = 71
        Printer.CurrentY = 42
        Printer.Print " 规    格"
        Printer.CurrentX = 91
        Printer.CurrentY = 42
        Printer.Line (93, 42)-(93, 47)
        Printer.CurrentX = 94
        Printer.CurrentY = 42
        Printer.Print "单价" & "(" & "元" & "/" & "箱" & ")"
        Printer.CurrentX = 114
        Printer.CurrentY = 42
        Printer.Line (115, 42)-(115, 47)
        Printer.CurrentX = 116
        Printer.CurrentY = 42
        Printer.Print " 数量(箱)"
        Printer.CurrentX = 135
        Printer.CurrentY = 42
        Printer.Line (136, 42)-(136, 47)
        Printer.CurrentX = 137
        Printer.CurrentY = 42
        Printer.Print "  金  额(元)"
        Printer.CurrentX = 160
        Printer.CurrentY = 42
        Printer.Line (160, 42)-(160, 47)
        Printer.CurrentX = 161
        Printer.CurrentY = 42
        Printer.Print "  备   注"
        Printer.CurrentX = 185
        Printer.CurrentY = 42
        Printer.Line (186, 42)-(186, 47)
        Printer.Line (5.75, 47)-(185.75, 47)
        CurrentY = 47
        
        
        Do While rs1.EOF <> True
1         Printer.FontSize = 10
          CurrentX = 5.75
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          CurrentX = CurrentX + 1
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("发货单编号")
          CurrentX = 41
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          Printer.CurrentX = CurrentX + 1
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("产品编号")
          CurrentX = 66
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          CurrentX = CurrentX + 1
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("规格")
          CurrentX = 93
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          
          CurrentX = 114
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY
          jg = Format$(rs1.Fields("单价"), "0.00")
          i = 1
          Do While i <= Len(jg)
             Printer.CurrentX = CurrentX
             Printer.CurrentY = CurrentY + 1
             Printer.Print Right(jg, i)
             i = i + 1
             CurrentX = CurrentX - 2
             If i > Len(jg) Then
                Exit Do
             End If
          Loop
          CurrentX = 115
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          CurrentX = CurrentX + 1
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("数量")
          CurrentX = 136
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          
          CurrentX = 159
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY
          jg = Format$(rs1.Fields("总金额"), "0.00")
          i = 1
          Do While i <= Len(jg)
             Printer.CurrentX = CurrentX
             Printer.CurrentY = CurrentY + 1
             Printer.Print Right(jg, i)
             i = i + 1
             CurrentX = CurrentX - 2
             If i > Len(jg) Then
                Exit Do
             End If
          Loop
          
          CurrentX = 160
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          CurrentX = CurrentX + 1
          Printer.CurrentX = CurrentX
          Printer.CurrentY = CurrentY + 1
          Printer.Print rs1.Fields("备注")
          CurrentX = 186
          Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
          Printer.Line (5.75, CurrentY + 5)-(185.75, CurrentY + 5)
          CurrentY = CurrentY + 5
          zsl = zsl + rs1.Fields("数量")
          zje = zje + rs1.Fields("总金额")
          rs1.MoveNext
          If CurrentY >= 250 Then
             Printer.NewPage
             CurrentY = 15
             Printer.Line (5.75, CurrentY)-(185.75, CurrentY)
             GoTo 1
          End If
          If rs1.EOF = True Then
             Exit Do
          End If
   Loop
   Printer.FontSize = 10
   Printer.CurrentY = CurrentY
   CurrentX = 5.75
   Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
   Printer.CurrentX = 9
   Printer.CurrentY = CurrentY + 1
   Printer.Print "合   计"
   CurrentX = 41
   Printer.CurrentX = CurrentX
    Printer.CurrentY = CurrentY
    Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
    CurrentX = 42
    Printer.CurrentX = CurrentX
    Printer.CurrentY = CurrentY
    Printer.Print ""
    CurrentX = 66
    Printer.CurrentX = CurrentX
    Printer.CurrentY = CurrentY
    Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
    CurrentX = 67
    Printer.CurrentX = CurrentX
    Printer.CurrentY = CurrentY
    Printer.Print ""
    CurrentX = 93
    Printer.CurrentX = CurrentX
    Printer.CurrentY = CurrentY
    Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
    CurrentX = 94
    Printer.CurrentX = CurrentX
    Printer.CurrentY = CurrentY + 1
    Printer.Print ""
    CurrentX = 115
    Printer.CurrentX = CurrentX
    Printer.CurrentY = CurrentY
    Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
    CurrentX = 116
    Printer.CurrentX = CurrentX
    Printer.CurrentY = CurrentY + 1
    Printer.Print zsl
    CurrentX = 136
    Printer.CurrentX = CurrentX
    Printer.CurrentY = CurrentY
    Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)

⌨️ 快捷键说明

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