If rs.Fields(j).Name = "承租人" Then
rs.Fields(j) = Text3.Text
End If
If rs.Fields(j).Name = "租赁期限" Then
rs.Fields(j) = Text4.Text
End If
If rs.Fields(j).Name = "租赁日期" Then
rs.Fields(j) = DTPicker2.Value
End If
Next j
End If
If frmdengjicuzu.Caption = "抵押登记窗口" Then
For j = 0 To rs.Fields.Count - 1
If rs.Fields(j).Name = "使用权权属人" Then
rs.Fields(j) = Text2.Text
End If
If rs.Fields(j).Name = "抵押权人" Then
rs.Fields(j) = Text3.Text
End If
If rs.Fields(j).Name = "抵押期限" Then
rs.Fields(j) = Text4.Text
End If
If rs.Fields(j).Name = "抵押日期" Then
rs.Fields(j) = DTPicker2.Value
End If
Next j
End If
rs.Update
MsgBox "已成功入库!"
Unload frmdengjicuzu
Load frmdengji
frmdengji.Show
End Sub
Private Sub Form_Load()
InitWidth = 5472
InitHeight = 5010
Dim Ctl As Control
' 记录每个 Control 的原始位置、大小、字型大小, 放在 Tag 属性中
On Error Resume Next '确保left, top, width, height, Tag属性没有全有的Control
For Each Ctl In Me '也能正常执行
Ctl.Tag = Ctl.Left & " " & Ctl.Top & " " & Ctl.Width & " " & Ctl.Height & " "
Ctl.Tag = Ctl.Tag & Ctl.FontSize & " "
Next Ctl
On Error GoTo 0
Command1.Enabled = False
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 的原始位置、大小、字型大小
For I = 0 To 4
TempPos = InStr(StartPos, Ctl.Tag, " ", vbTextCompare)
If TempPos > 0 Then
D(I) = Mid(Ctl.Tag, StartPos, TempPos - StartPos)
StartPos = TempPos + 1
Else
D(I) = 0
End If
' 根据比例设定 Control 的位置、大小、字型大小
Ctl.Move D(0) * ScaleX, D(1) * ScaleY, D(2) * ScaleX, D(3) * ScaleY
'Ctl.Width = D(2) * ScaleX
'Ctl.Height = D(3) * ScaleY