论文首页哲学论文经济论文法学论文教育论文文学论文历史论文理学论文工学论文医学论文管理论文艺术论文 |
三:初始登记界面设计
初始界面代码设计:
Option Explicit
Public InitWidth As Long ' Form 的原始大小
Public InitHeight As Long
Public flstype As Integer
Public zdhao1, zdhao As String
Public selrow As Integer
Private Sub Command1_Click()
Dim I As Integer
rs.AddNew
If flxGridhistory.TextMatrix(1, 1) = "" Then
MsgBox "宗地号不能为空!", vbInformation, "输入检查"
Else
For I = 0 To flxGridhistory.Rows - 2
flxGridhistory.Row = I + 1
selrow = flxGridhistory.Row
flstype = rs.Fields(selrow - 1).Type
Select Case flstype
Case 10
rs.Fields(I) = flxGridhistory.TextMatrix(I + 1, 1) & ""
Case 8
If flxGridhistory.TextMatrix(I + 1, 1) <> "" Then
rs.Fields(I) = flxGridhistory.TextMatrix(I + 1, 1)
Else
rs.Fields(I) = DateSerial(1900, 1, 1)
End If
Case 6, 3, 4
If flxGridhistory.TextMatrix(I + 1, 1) <> "" Then 本文来自中国科教评价网
rs.Fields(I) = flxGridhistory.TextMatrix(I + 1, 1)
Else
rs.Fields(I) = 0
End If
End Select
Next I
On Error GoTo errordowith
rs.Update
On Error GoTo 0
db.Recordsets.Refresh
If flxGridhistory.TextMatrix(1, 1) = "" Then
Exit Sub
Else
MsgBox "入库完毕!"
zdhao = flxGridhistory.TextMatrix(1, 1)
End If
Command2.Enabled = True
Command1.Enabled = False
End If
Exit Sub
errordowith:
MsgBox "有重复数据!!!"
End Sub
Private Sub Command2_Click()
rs.FindFirst ("宗地号 = '" & zdhao & "'")
rs.Delete
Dim j As Integer
For j = 1 To flxGridhistory.Rows - 1
flxGridhistory.TextMatrix(j, 1) = ""
Next j
Command2.Enabled = False
End Sub
Private Sub Command3_Click()
Unload Me
frmdengji.Show
End Sub
Private Sub Command4_Click()
Dim j, m As Integer
If flxGridhistory.TextMatrix(1, 1) = "" Then
MsgBox "宗地号不能为空,请重新输入!", vbOKOnly + vbInformation, "输入检查"
Else
'zdhao = flxGridhistory.TextMatrix(1, 1)
rs.FindFirst ("宗地号 = '" & zdhao1 & "'")
On Error GoTo 0
End Sub
Private Sub Form_Resize()
Dim D(4) As Double
Dim I As Long
Dim TempPos As Long
Dim StartPos As Long
Dim Ctl As Control
Dim TempVisible As Boolean
Dim ScaleX As Double
Dim ScaleY As Double
ScaleX = ScaleWidth / InitWidth
ScaleY = ScaleHeight / InitHeight
On Error Resume Next
For Each Ctl In Me
TempVisible = Ctl.Visible
Ctl.Visible = False
StartPos = 1
' 读取 Control 的原始位置、大小、字型大小
(科教范文网http://fw.NSEAC.com编辑发布)