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

📄 gare.frm

📁 这个就不用多说了
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   465
      Left            =   8505
      TabIndex        =   1
      Top             =   825
      Width           =   1650
   End
   Begin VB.Label Label6 
      BackColor       =   &H80000009&
      BackStyle       =   0  'Transparent
      Caption         =   "国 有 资 产 卡 片"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   525
      Left            =   3885
      TabIndex        =   0
      Top             =   810
      Width           =   4065
   End
End
Attribute VB_Name = "Gare"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim myclass As New GyzcCare
Public state As String

Private Sub DTPicker1_Change()
txtyear.Text = DateDiff("yyyy", DTPicker1.Value, Now)
End Sub





Private Sub Cbodw_Click()
Cbodw.Tag = Cbodw.ItemData(Cbodw.ListIndex)
End Sub

Private Sub cbojldw_Click()
cbojldw.Tag = cbojldw.ItemData(cbojldw.ListIndex)
End Sub

Private Sub Cbolb_Click()
Cbolb.Tag = Cbolb.ItemData(Cbolb.ListIndex)
End Sub

Private Sub cbosyqk_Click()
cbosyqk.Tag = cbosyqk.ItemData(cbosyqk.ListIndex)
End Sub

Private Sub Cbozjfs_Click()
Cbozjfs.Tag = Cbozjfs.ItemData(Cbozjfs.ListIndex)
End Sub

Private Sub Command1_Click()
MonthView1.Visible = True
End Sub

Private Sub Form_Load()

 Dim strSql As String
        strSql = "select ID,Name from AddMode"
         Call myclass.AddDataComboBox(strSql, Cbozjfs)
        strSql = "select Bm, Name from GyzcCode where Mjbz=1"
       Call myclass.AddDataComboBox(strSql, Cbolb)
        strSql = "select Bm,Name from DwBmCode where Mjbz=1"
        Call myclass.AddDataComboBox(strSql, Cbodw)
        strSql = "select ID,Name from UseState"
         Call myclass.AddDataComboBox(strSql, cbosyqk)
           strSql = "select ID,Name from Jldw"
         Call myclass.AddDataComboBox(strSql, cbojldw)
       Call ToolbarEnable
       LblSj.Caption = JZYEAR & "年" & JZMONTH & "月"
       If state = "Edit" Then
       
       End If
End Sub
Sub ToolbarEnable()
If state = "Add" Then
Toolbar1.Buttons("Save").Enabled = True
Toolbar1.Buttons("Add").Enabled = False
Toolbar1.Buttons("Edit").Enabled = False
Toolbar1.Buttons("Delete").Enabled = False
Toolbar1.Buttons("Goto").Enabled = False
Toolbar1.Buttons("Less").Enabled = False
Toolbar1.Buttons("NotLess").Enabled = False

End If
If state = "Save" Then
Toolbar1.Buttons("Save").Enabled = False
Toolbar1.Buttons("Add").Enabled = True
Toolbar1.Buttons("Edit").Enabled = True
Toolbar1.Buttons("Delete").Enabled = True
Toolbar1.Buttons("Goto").Enabled = False
Toolbar1.Buttons("Less").Enabled = False
Toolbar1.Buttons("NotLess").Enabled = False

End If
If state = "Edit" Then
Toolbar1.Buttons("Save").Enabled = True
Toolbar1.Buttons("Add").Enabled = False
Toolbar1.Buttons("Edit").Enabled = False
Toolbar1.Buttons("Delete").Enabled = False
Toolbar1.Buttons("Goto").Enabled = False
Toolbar1.Buttons("Less").Enabled = False
Toolbar1.Buttons("NotLess").Enabled = False
txtBH.Enabled = False

End If
If state = "Delete" Then
Toolbar1.Buttons("Save").Enabled = False
Toolbar1.Buttons("Add").Enabled = False
Toolbar1.Buttons("Edit").Enabled = False
Toolbar1.Buttons("Delete").Enabled = True
Toolbar1.Buttons("Goto").Enabled = False
Toolbar1.Buttons("Less").Enabled = False
Toolbar1.Buttons("NotLess").Enabled = False

End If

If state = "Find" Then
Toolbar1.Buttons("Save").Enabled = False
Toolbar1.Buttons("Add").Enabled = False
Toolbar1.Buttons("Edit").Enabled = False
Toolbar1.Buttons("Delete").Enabled = False
Toolbar1.Buttons("Goto").Enabled = False
Toolbar1.Buttons("Less").Enabled = False
Toolbar1.Buttons("NotLess").Enabled = False

End If
If state = "Less" Then
Toolbar1.Buttons("Save").Enabled = False
Toolbar1.Buttons("Add").Enabled = False
Toolbar1.Buttons("Edit").Enabled = False
Toolbar1.Buttons("Delete").Enabled = False
Toolbar1.Buttons("Goto").Enabled = False
Toolbar1.Buttons("Less").Enabled = True
Toolbar1.Buttons("NotLess").Enabled = False

End If
If state = "NotLess" Then
Toolbar1.Buttons("Save").Enabled = False
Toolbar1.Buttons("Add").Enabled = False
Toolbar1.Buttons("Edit").Enabled = False
Toolbar1.Buttons("Delete").Enabled = False
Toolbar1.Buttons("Goto").Enabled = False
Toolbar1.Buttons("Less").Enabled = False
Toolbar1.Buttons("NotLess").Enabled = True

End If
If state = "Goto" Then
Toolbar1.Buttons("Save").Enabled = False
Toolbar1.Buttons("Add").Enabled = False
Toolbar1.Buttons("Edit").Enabled = False
Toolbar1.Buttons("Delete").Enabled = False
Toolbar1.Buttons("Goto").Enabled = True
Toolbar1.Buttons("Less").Enabled = False
Toolbar1.Buttons("NotLess").Enabled = False

End If
End Sub



Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
txttime = Format(MonthView1.Value, yyyy, mm, dd)
MonthView1.Visible = False
End Sub



Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim strbh As String, strcodeId As String, strmodeId As String, strje As String, _
strgg As String, strsl As String, strjldw As String, strdwbmid As String, _
strJzyear As String, strJzmonth As String, strGzzq As String, strbz As String, _
strsyqk As String
 If Button.Key = "Add" Then
    Call clear
    state = "Add"
    Call ToolbarEnable
 End If
If Button.Key = "Save" Then
   If check = True Then
     Exit Sub
   End If
   strbh = txtBH.Text
   strcodeId = Cbolb.Tag
   strname = txtName.Text
   strmodeId = Cbozjfs.Tag
   strje = txtJe.Text
   strgg = txtGG.Text
   strsl = txtsl.Text
   
   strjldw = cbojldw.Tag

 

   strdwbmid = Cbodw.Tag
   strJzyear = txtyear.Text
   strJzmonth = txtmonth.Text
   strGzzq = txttime.Text
   strbz = txtBz.Text
   strsyqk = cbosyqk.Tag
 
  'If state = "Add" Then
  If myclass.AddCare(strbh, strcodeId, strname, strmodeId, strje, strgg, _
  strsl, strjldw, strdwbmid, strJzyear, strJzmonth, strGzzq, strbz, strsyqk) Then
  state = "Save"
  Call ToolbarEnable
  MsgBox "保存成功", vbInformation, "提示"
  End If
End If
If Button.Key = "Cancel" Then
Unload Me
End If
If Button.Key = "Find" Then
state = "Find"
CareFind.Show 1
End If
If Button.Key = "Edit" Then
state = "Edit"
Call ToolbarEnable
End If
If Button.Key = "Delete" Then
If myclass.DeleteCare("delete GyzcCare where BH=" & "'" & txtBH.Text & "'") Then
MsgBox "删除成功", vbInformation, "提示"
Unload Me
End If
End If
If Button.Key = "Less" Then
Less.Show 1
End If
If Button.Key = "NotLess" Then
    If myclass.Cancelless(txtBH.Text) Then
          MsgBox "取消成功", vbInformation, "提示"
        modelable.Caption = ""
     End If
End If
If Button.Key = "Goto" Then
GotoForm.Show 1
End If
If Button.Key = "Cancel" Then
   Unload Me
End If


End Sub

Sub clear()
txtBH = ""
Cbolb = ""
Cbolb.Tag = ""
Cbodw = ""
Cbodw.Tag = ""
txtName = ""
txtGG = ""
txtsl = ""
cbojldw = ""
cbojldw = ""
txtJe = ""
Cbozjfs = ""
Cbozjfs.Tag ""
txttime = ""
.txtyear = ""
.txtmonth = ""
.txtBz = ""
.cbosyqk = ""
.cbosyqk.Tag = ""
End Sub

Function check() As Boolean
check = False
If txtBH.Text = "" Then
MsgBox "编号不能为空", vbInformation, "提示"
check = True
Exit Function
End If
If txtName.Text = "" Then
MsgBox "名称不能为空", vbInformation, "提示"
check = True
Exit Function
End If
If myclass.checkComboBox(cbojldw) Then
MsgBox "计量单位不对", vbInformation, "提示"
check = True
Exit Function
End If
If myclass.checkComboBox(Cbodw) Then
MsgBox "单位不对", vbInformation, "提示"
check = True
Exit Function
End If
If myclass.checkComboBox(Cbozjfs) Then
MsgBox "购入方式不对", vbInformation, "提示"
check = True
Exit Function
End If
If myclass.checkComboBox(cbosyqk) Then
MsgBox "使用情况不对", vbInformation, "提示"
check = True
Exit Function
End If
If myclass.checkComboBox(Cbolb) Then
MsgBox "类别不对", vbInformation, "提示"
check = True
Exit Function
End If
If Not IsNumeric(txtJe.Text) Then
MsgBox "金额不对", vbInformation, "提示"
check = True
Exit Function
End If

End Function



Private Sub txttime_Change()
If state = "Add" Then
If txttime <> "" Then
     Call Js_Year_Month
Else
txtyear = ""
txtmonth = ""
End If
End If
End Sub

Private Sub txttime_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Sub Js_Year_Month()
Select Case JZYEAR - Year(txttime)
    Case Is >= 1
   If JZMONTH - Month(txttime) >= 0 Then
       txtyear = JZYEAR - Year(txttime)
       txtmonth = JZMONTH - Month(txttime)
       If txtmonth = 0 Then
       txtmonth = ""
       End If
   Else
      txtyear = JZYEAR - Year(txttime) - 1
       If txtyear = 0 Then
       txtyear = ""
       End If
      txtmonth = 12 + JZMONTH - Month(txttime)
    End If
Case Is = 0
If JZMONTH - Month(txttime) >= 0 Then
    
       txtmonth = JZMONTH - Month(txttime)
       If txtmonth = 0 Then
       txtmonth = ""
       End If
       End If
  End Select

End Sub

⌨️ 快捷键说明

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