PC User
Registered User.
- Local time
- Today, 06:35
- Joined
- Jul 28, 2002
- Messages
- 193
I found this code somewhere, but I keep getting errors on it. Try it and see what I mean. Is anyone familiar with the Scripting Library and can you help me on this?
===================================
Private Sub btnCopyRow_Click()
Dim dict As New Scripting.Dictionary
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
dict.Add ctl.NAME, ctl.value
End If
If ctl.ControlType = acCheckBox Then
dict.Add ctl.NAME, ctl.value
End If
Next ctl
End Sub
===================================
Private Sub btnPasteRow_Click()
Dim dict As New Scripting.Dictionary
Dim ctl As Control
For Each ctl In Me.Controls
ctl.value = dict(ctl.NAME)
Next ctl
End Sub
===================================
Thanks,
PC
===================================
Private Sub btnCopyRow_Click()
Dim dict As New Scripting.Dictionary
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
dict.Add ctl.NAME, ctl.value
End If
If ctl.ControlType = acCheckBox Then
dict.Add ctl.NAME, ctl.value
End If
Next ctl
End Sub
===================================
Private Sub btnPasteRow_Click()
Dim dict As New Scripting.Dictionary
Dim ctl As Control
For Each ctl In Me.Controls
ctl.value = dict(ctl.NAME)
Next ctl
End Sub
===================================
Thanks,
PC