【VB开源代码栏目提醒】:网学会员VB开源代码为您提供FMNEW_BMEM.frm参考,解决您在FMNEW_BMEM.frm学习中工作中的难题,参考学习。
VERSION 5.00
Begin VB.Form FMNEW_BMEM
Caption = "Form1"
ClientHeight = 1695
ClientLeft = 60
ClientTop = 345
ClientWidth = 7575
LinkTopic = "Form1"
ScaleHeight = 1695
ScaleWidth = 7575
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "新增"
Height = 1455
Left = 4920
TabIndex = 6
Top = 120
Width = 2535
End
Begin VB.TextBox BMTL1
DataField = "BMTL1"
DataSource = "Adodc1"
BeginProperty Font
Name = "Arial"
Size = 15.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 1680
TabIndex = 2
Top = 1080
Width = 3000
End
Begin VB.TextBox BMNAM
DataField = "BMNAM"
DataSource = "Adodc1"
BeginProperty Font
Name = "Arial"
Size = 15.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 1680
TabIndex = 1
Top = 600
Width = 3000
End
Begin VB.TextBox BMENO
DataField = "BMENO"
DataSource = "Adodc1"
BeginProperty Font
Name = "Arial"
Size = 15.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 1680
TabIndex = 0
Top = 120
Width = 3000
End
Begin
VB.Label LBBMTL1
Caption = "现居电话"
BeginProperty Font
Name = "Arial"
Size = 15.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 100
TabIndex = 5
Top = 1147
Width = 2000
End
Begin VB.Label LBBMNAM
Caption = "中文"
BeginProperty Font
Name = "Arial"
Size = 15.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 100
TabIndex = 4
Top = 667
Width = 2000
End
Begin VB.Label LBBMENO
Caption = "
会员编号"
BeginProperty Font
Name = "Arial"
Size = 15.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 120
TabIndex = 3
Top = 180
Width = 1995
End
End
Attribute VB_Name = "FMNEW_BMEM"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public CN As New ADODB.Connection, RS As New ADODB.Recordset
Public SQL As String
Const DBPATH = "./POS.MDB"
Const ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPATH
Private Sub BMENO_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
BMNAM.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub
Private Sub BMNAM_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
BMTL1.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub
Private Sub BMTL1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Command1_Click
End If
End Sub
Private Sub Command1_Click()
CN.Open ConnString
If (BMENO.Text = "") Then
SQL = "SELECT MAX(BMENO) AS MAXENO FROM BMEM "
RS.Open SQL, ConnString, , , adCmdText
BMENO.Text = RS("MAXENO") + 1
RS.Close
End If
If (BMENO.Text = "") And (BMNAM.Text = "") Then
MsgBox "输入资料不完整"
Else
SQL = "INSERT INTO BMEM "
SQL = SQL & "( BMENO, BMNAM, BMTL1 )"
SQL = SQL & " VALUES ("
SQL = SQL & " '" & BMENO.Text & "' , "
SQL = SQL & " '" & BMNAM.Text & "' , "
SQL = SQL & " '" & BMTL1.Text & "' "
SQL = SQL & " ) "
CN.Execute SQL
FMPOSA.INPUT_ENTER.Text = BMENO.Text
End If
CN.Close
Unload FMNEW_BMEM
End Sub