📄 form1.frm
字号:
Else
address1.Text = ""
End If
If AdoRs!post1 <> "" Then
post1.Text = AdoRs!post1
Else
post1.Text = ""
End If
If AdoRs!jyfw1 <> "" Then
jyfw1.Text = AdoRs!jyfw1
Else
jyfw1.Text = ""
End If
If AdoRs!tbcsmc1 <> "" Then
tbcsmc1.Text = AdoRs!tbcsmc1
Else
tbcsmc1.Text = ""
End If
If AdoRs!dz1 <> "" Then
dz1.Text = AdoRs!dz1
Else
dz1.Text = ""
End If
If AdoRs!cshylb1 <> "" Then
cshylb1.Text = AdoRs!cshylb1
Else
cshylb1.Text = ""
End If
If AdoRs!csnsshzz1 <> "" Then
csnsshzz1.Text = AdoRs!csnsshzz1
Else
csnsshzz1.Text = ""
End If
If AdoRs!yymj1 <> "" Then
yymj1.Text = AdoRs!yymj1
Else
yymj1.Text = ""
End If
If AdoRs!ywdxbf1 <> "" Then
ywdxbf1.Text = AdoRs!ywdxbf1
Else
ywdxbf1.Text = ""
End If
If AdoRs!jzjg1 <> "" Then
jzjg1.Text = AdoRs!jzjg1
Else
jzjg1.Text = ""
End If
If AdoRs!fhsszk1 <> "" Then
fhsszk1.Text = AdoRs!fhsszk1
Else
fhsszk1.Text = ""
End If
If AdoRs!mrzrxe1 <> "" Then
mrzrxe1.Text = AdoRs!mrzrxe1
Else
mrzrxe1.Text = ""
End If
If AdoRs!ljzrxe1 <> "" Then
ljzrxe1.Text = AdoRs!ljzrxe1
Else
ljzrxe1.Text = ""
End If
If AdoRs!jzbxf1 <> "" Then
jzbxf1.Text = AdoRs!jzbxf1
Else
jzbxf1.Text = ""
End If
If AdoRs!bxf1 <> "" Then
bxf1.Text = AdoRs!bxf1
Else
bxf1.Text = ""
End If
If AdoRs!bxf2 <> "" Then
bxf2.Text = AdoRs!bxf2
Else
bxf2.Text = ""
End If
If AdoRs!bxqjy1 <> "" Then
bxqjy1.Text = AdoRs!bxqjy1
Else
bxqjy1.Text = ""
End If
If AdoRs!bxqjzn1 <> "" Then
bxqjzn1.Text = AdoRs!bxqjzn1
Else
bxqjzn1.Text = ""
End If
If AdoRs!bxqjzy1 <> "" Then
bxqjzy1.Text = AdoRs!bxqjzy1
Else
bxqjzy1.Text = ""
End If
If AdoRs!bxqjzr1 <> "" Then
bxqjzr1.Text = AdoRs!bxqjzr1
Else
bxqjzr1.Text = ""
End If
If AdoRs!bxqjdn1 <> "" Then
bxqjdn1.Text = AdoRs!bxqjdn1
Else
bxqjdn1.Text = ""
End If
If AdoRs!bxqjdy1 <> "" Then
bxqjdy1.Text = AdoRs!bxqjdy1
Else
bxqjdy1.Text = ""
End If
If AdoRs!bxqjdr1 <> "" Then
bxqjdr1.Text = AdoRs!bxqjdr1
Else
bxqjdr1.Text = ""
End If
If AdoRs!bxhtzyjjfs1 <> "" Then
bxhtzyjjfs1.Text = AdoRs!bxhtzyjjfs1
Else
bxhtzyjjfs1.Text = ""
End If
If AdoRs!tbyd1 <> "" Then
tbyd1.Text = AdoRs!tbyd1
Else
tbyd1.Text = ""
End If
If AdoRs!bxrlxdz1 <> "" Then
bxrlxdz1.Text = AdoRs!bxrlxdz1
Else
bxrlxdz1.Text = ""
End If
If AdoRs!yzbm1 <> "" Then
yzbm1.Text = AdoRs!yzbm1
Else
yzbm1.Text = ""
End If
If AdoRs!cz1 <> "" Then
cz1.Text = AdoRs!cz1
Else
cz1.Text = ""
End If
If AdoRs!hb1 <> "" Then
hb1.Text = AdoRs!hb1
Else
hb1.Text = ""
End If
If AdoRs!zd1 <> "" Then
zd1.Text = AdoRs!zd1
Else
zd1.Text = ""
End If
If AdoRs!jb1 <> "" Then
jb1.Text = AdoRs!jb1
Else
jb1.Text = ""
End If
If AdoRs!n1 <> "" Then
n1.Text = AdoRs!n1
Else
n1.Text = ""
End If
If AdoRs!y1 <> "" Then
y1.Text = AdoRs!y1
Else
y1.Text = ""
End If
If AdoRs!r1 <> "" Then
r1.Text = AdoRs!r1
Else
r1.Text = ""
End If
AdoRs.Close
Else
MsgBox "请选择记录"
End If
End Sub
Private Sub Command12_Click()
On Error Resume Next
Frame2.Visible = False
End Sub
Private Sub Command13_Click()
On Error Resume Next
List1.Clear
List2.Clear
List3.Clear
List4.Clear
List5.Clear
Dim strSQl As String
Dim AdoRs1 As New ADODB.Recordset
strSQl = "select * from bxd order by bxdh1"
AdoRs1.Open strSQl, cn, adOpenKeyset, adLockReadOnly
Do While Not AdoRs1.EOF
List1.AddItem AdoRs1!username1
List2.AddItem AdoRs1!address1
List3.AddItem AdoRs1!phone1
List4.AddItem AdoRs1!bh
List5.AddItem AdoRs1!bxdh1
AdoRs1.MoveNext
Loop
Label36.Caption = AdoRs1.RecordCount
AdoRs1.Close
Frame2.Top = Frame1.Top
Frame2.Left = Frame1.Left
Frame2.Visible = True
End Sub
Private Sub Command14_Click()
On Error Resume Next
strSQl = "select * from bxd where bxdh1='" + bxdh1.Text + "'"
AdoRs.Open strSQl, cn, adOpenKeyset, adLockOptimistic
reco = AdoRs.RecordCount
If reco <> 0 Then
strSQl = AdoRs!bh
End If
AdoRs.Close
If reco = 0 Then
Call writeado
'MsgBox "保存成功"
Else
' zt = MsgBox("存在同名记录,覆盖选是,重建选否,放弃先取消。", vbYesNoCancel + vbQuestion + vbDefaultButton2)
' If zt = vbNo Then
' Call writeado
' End If
' If zt = vbOK Then
cn.Execute "delete from bxd where bh=" & CInt(strSQl)
Call writeado
' End If
' If zt <> vbCancel Then
' MsgBox "保存完成"
' End If
End If
End Sub
Private Sub Command15_Click()
On Error Resume Next
Dim WordTemps As New Word.Application
WordTemps.Documents.Open App.Path + "\合同模板.doc", False
WordTemps.Visible = True '显示WORD窗口
'WordTemps.Quit
End Sub
Private Sub Command16_Click()
On Error Resume Next
Dim WordTemps As New Word.Application
WordTemps.Documents.Open App.Path + "\发票模板.doc", False
WordTemps.Visible = True '显示WORD窗口
End Sub
Private Sub Command17_Click()
On Error Resume Next
Unload id
End Sub
Private Sub Command18_Click()
Shell "explorer.exe /e," & Text1.Text, vbNormalFocus
End Sub
Private Sub Command19_Click()
On Error Resume Next
Dim strSQl As String
strSQl = "select * from set1"
Dim AdoRs1 As New ADODB.Recordset
AdoRs1.Open strSQl, cn, adOpenKeyset, adLockReadOnly
If AdoRs1!password1 = DigestStrToHexStr(password1.Text) Then
Frame4.Visible = False
Else
MsgBox "密码错误"
password1.SetFocus
AutoSelect bxdh1
End If
AdoRs1.Close
End Sub
Sub Command2_Click()
On Error Resume Next
Dim WordTemps As New Word.Application
WordTemps.Documents.Add App.Path + "\合同模板.doc", False
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxdh1"
WordTemps.Selection.TypeText bxdh1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "username1"
WordTemps.Selection.TypeText username1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "phone1"
WordTemps.Selection.TypeText phone1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "address1"
WordTemps.Selection.TypeText address1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "post1"
WordTemps.Selection.TypeText post1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "jyfw1"
WordTemps.Selection.TypeText jyfw1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "tbcsmc1"
WordTemps.Selection.TypeText tbcsmc1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "dz1"
WordTemps.Selection.TypeText dz1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "cshylb1"
WordTemps.Selection.TypeText cshylb1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "csnsshzz1"
WordTemps.Selection.TypeText csnsshzz1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "yymj1"
WordTemps.Selection.TypeText yymj1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "ywdxbf1"
WordTemps.Selection.TypeText ywdxbf1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "jzjg1"
WordTemps.Selection.TypeText jzjg1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "fhsszk1"
WordTemps.Selection.TypeText fhsszk1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "mrzrxe1"
WordTemps.Selection.TypeText mrzrxe1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "ljzrxe1"
WordTemps.Selection.TypeText ljzrxe1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "jzbxf1"
WordTemps.Selection.TypeText jzbxf1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxf1"
WordTemps.Selection.TypeText bxf1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxf2"
WordTemps.Selection.TypeText bxf2.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxqjy1"
WordTemps.Selection.TypeText bxqjy1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxqjzn1"
WordTemps.Selection.TypeText bxqjzn1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxqjzy1"
WordTemps.Selection.TypeText bxqjzy1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxqjzr1"
WordTemps.Selection.TypeText bxqjzr1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxqjdn1"
WordTemps.Selection.TypeText bxqjdn1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxqjdy1"
WordTemps.Selection.TypeText bxqjdy1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxqjdr1"
WordTemps.Selection.TypeText bxqjdr1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxhtzyjjfs1"
WordTemps.Selection.TypeText bxhtzyjjfs1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "tbyd1"
WordTemps.Selection.TypeText tbyd1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "bxrlxdz1"
WordTemps.Selection.TypeText bxrlxdz1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "yzbm1"
WordTemps.Selection.TypeText yzbm1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "cz1"
WordTemps.Selection.TypeText cz1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "hb1"
WordTemps.Selection.TypeText hb1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "zd1"
WordTemps.Selection.TypeText zd1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "jb1"
WordTemps.Selection.TypeText jb1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "n1"
WordTemps.Selection.TypeText n1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "y1"
WordTemps.Selection.TypeText y1.Text
WordTemps.Selection.GoTo wdGoToBookmark, , , "r1"
WordTemps.Selection.TypeText r1.Text
WordTemps.ActiveDocument.SaveAs FileName:=App.Path + "\保险合同.doc", FileFormat:=wdFormatDocument, _
LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _
:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False
WordTemps.ActiveDocument.PrintOut
DoEvents
WordTemps.Visible = False '显示WORD窗口
WordTemps.Quit
MsgBox "打印操作已经发出,请保持打印机连接"
'If MsgBox("打印完成!是否将数据保存到数据库!", vbYesNo + vbQuestion + vbDefaultButton2) = vbYes Then Call Command14_Click
End Sub
Private Sub Command20_Click()
On Error Resume Next
If Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Then
MsgBox "密码不可为空"
Else
Dim strSQl As String
strSQl = "select * from set1"
Dim AdoRs1 As New ADODB.Recordset
AdoRs1.Open strSQl, cn, adOpenKeyset, adLockBatchOptimistic
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -