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

📄 sbappendform.frm

📁 进销存管理(ADO+Acess),适合初学者使用!
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form sbappendform 
   BorderStyle     =   0  'None
   ClientHeight    =   5070
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   5145
   LinkTopic       =   "Form1"
   Picture         =   "sbappendform.frx":0000
   ScaleHeight     =   338
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   343
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox data_d 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Height          =   270
      Left            =   2400
      MaxLength       =   50
      TabIndex        =   10
      Top             =   2640
      Width           =   1215
   End
   Begin VB.TextBox data_f 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Height          =   270
      Left            =   2400
      MaxLength       =   20
      TabIndex        =   11
      Top             =   3120
      Width           =   1215
   End
   Begin VB.TextBox data_g 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Height          =   270
      Left            =   2400
      MaxLength       =   50
      TabIndex        =   12
      Top             =   3600
      Width           =   1215
   End
   Begin MSComCtl2.DTPicker data_e 
      Height          =   300
      Left            =   2400
      TabIndex        =   13
      Top             =   765
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   529
      _Version        =   393216
      CalendarBackColor=   16777215
      Format          =   24707072
      CurrentDate     =   37417
   End
   Begin VB.TextBox data_c 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Height          =   270
      Left            =   2400
      MaxLength       =   20
      TabIndex        =   9
      Top             =   2235
      Width           =   1215
   End
   Begin VB.TextBox data_b 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Height          =   270
      Left            =   2400
      MaxLength       =   20
      TabIndex        =   8
      Top             =   1755
      Width           =   1215
   End
   Begin VB.TextBox data_a 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Height          =   270
      Left            =   2400
      MaxLength       =   50
      TabIndex        =   7
      Top             =   1275
      Width           =   1215
   End
   Begin VB.Label Label6 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "邮  编"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   600
      TabIndex        =   20
      Top             =   3165
      Width           =   1500
   End
   Begin VB.Label Label5 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "银行帐号"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   600
      TabIndex        =   19
      Top             =   3645
      Width           =   1500
   End
   Begin VB.Label appendfrmmove 
      BackColor       =   &H00C0C0C0&
      BackStyle       =   0  'Transparent
      Height          =   285
      Left            =   360
      TabIndex        =   18
      Top             =   0
      Width           =   4320
   End
   Begin VB.Label Label4 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "日  期"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   600
      TabIndex        =   17
      Top             =   840
      Width           =   1500
   End
   Begin VB.Label Label3 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "地  址"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   600
      TabIndex        =   16
      Top             =   2700
      Width           =   1500
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "联系人"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   600
      TabIndex        =   15
      Top             =   2280
      Width           =   1500
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "电  话"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   600
      TabIndex        =   14
      Top             =   1800
      Width           =   1500
   End
   Begin VB.Label lb_a 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "商家名称"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   600
      TabIndex        =   6
      Top             =   1320
      Width           =   1500
   End
   Begin VB.Label append_a 
      BackStyle       =   0  'Transparent
      Height          =   330
      Left            =   1440
      TabIndex        =   5
      Top             =   4200
      Width           =   885
   End
   Begin VB.Label exit_a 
      BackStyle       =   0  'Transparent
      Height          =   330
      Left            =   2880
      TabIndex        =   4
      Top             =   4200
      Width           =   885
   End
   Begin VB.Label append_b 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "填 加"
      ForeColor       =   &H00404040&
      Height          =   180
      Left            =   1620
      TabIndex        =   3
      Top             =   4275
      Width           =   540
   End
   Begin VB.Shape append_c 
      BorderColor     =   &H00C0C0C0&
      FillColor       =   &H00C0C0C0&
      Height          =   330
      Left            =   1440
      Top             =   4200
      Width           =   885
   End
   Begin VB.Label exit_b 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "返 回"
      ForeColor       =   &H00404040&
      Height          =   180
      Left            =   3090
      TabIndex        =   2
      Top             =   4275
      Width           =   495
   End
   Begin VB.Shape exit_c 
      BorderColor     =   &H00C0C0C0&
      FillColor       =   &H00C0C0C0&
      Height          =   330
      Left            =   2880
      Top             =   4200
      Width           =   885
   End
   Begin VB.Label formcaption 
      BackStyle       =   0  'Transparent
      Caption         =   "填加数据"
      ForeColor       =   &H00000000&
      Height          =   165
      Left            =   2130
      TabIndex        =   1
      Top             =   90
      Width           =   735
   End
   Begin VB.Label frmcaption2 
      BackStyle       =   0  'Transparent
      Caption         =   "填加数据"
      ForeColor       =   &H00FFFFFF&
      Height          =   165
      Left            =   2130
      TabIndex        =   0
      Top             =   75
      Width           =   735
   End
End
Attribute VB_Name = "sbappendform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim rsTemp As ADODB.Recordset

Sub ClearData()
   data_a.Text = ""
   data_b.Text = ""
   data_c.Text = ""
   data_d.Text = ""
   data_f.Text = ""
   data_g.Text = ""
   
End Sub


Sub AppendRecord()
 On Error GoTo err_exit
  If Trim(data_a.Text) = "" Or Trim(data_b.Text) = "" Or Trim(data_c.Text) = "" Or Trim(data_d.Text) = "" Or Trim(data_f.Text) = "" Or Trim(data_g.Text) = "" Then
      vMessageBox GetLStr(1), 2, 0
      data_a.SetFocus
      Exit Sub
  End If
  rsTemp.Open "select 商家名称,联系人 from 商家表 where 商家名称='" & _
               Trim(data_a.Text) & "'", mydata.condata, adOpenStatic, adLockReadOnly
  If rsTemp.RecordCount > 0 Then
       vMessageBox GetLStr(9) & Trim(rsTemp("联系人")), 1, 0
       data_a.SetFocus
     Else
       mydata.condata.Execute "insert into 商家表 " & _
             "(商家名称,电话,联系人,地址,邮编,银行帐号,日期) values ('" & _
             Trim(data_a.Text) & "','" & _
             Trim(data_b.Text) & "','" & _
             Trim(data_c.Text) & "','" & _
             Trim(data_d.Text) & "','" & _
             Trim(data_f.Text) & "','" & _
             Trim(data_g.Text) & "'," & _
             "#" & Format(data_e.Value, "YYYY-MM-DD") & "#" & _
             ")"
             
       vMessageBox GetLStr(3), 1, 0
       ClearData
       data_a.SetFocus
             
  End If
  rsTemp.Close
  Exit Sub

err_exit:
   vMessageBox Err.Description, 2, 0
   
End Sub
Private Sub append_a_Click()

  AppendRecord
  
End Sub

Private Sub appendfrmmove_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  ReleaseCapture
  SendMessage Me.hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0
End Sub


Private Sub data_a_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then SendKeys "{TAB}"
End Sub

Private Sub data_b_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then SendKeys "{TAB}"
End Sub

Private Sub data_c_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then SendKeys "{TAB}"
End Sub

Private Sub data_d_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then SendKeys "{TAB}"

End Sub




Private Sub data_f_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then SendKeys "{TAB}"
End Sub

Private Sub data_g_KeyPress(KeyAscii As Integer)
 If KeyAscii = 13 Then
    AppendRecord
 End If
End Sub

Private Sub exit_a_Click()
  Unload Me
  sbreg.Show
  ReGird 101
End Sub


Private Sub Form_Load()
  CenterForm Me
  Set rsTemp = New ADODB.Recordset
  SetLForm 22
End Sub

Private Sub append_a_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  append_c.BorderColor = &H808080
End Sub

Private Sub append_a_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  append_c.BorderColor = &HC0C0C0
End Sub



Private Sub exit_a_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  exit_c.BorderColor = &H808080
End Sub

Private Sub exit_a_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  exit_c.BorderColor = &HC0C0C0
End Sub

Private Sub Form_Unload(Cancel As Integer)
  Set rsTemp = Nothing
End Sub

⌨️ 快捷键说明

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