VBA from Excel userform to MS Access

djossh

Registered User.
Local time
Today, 19:05
Joined
Oct 19, 2011
Messages
89
Hi I have this code from my Excel userform.. I want to use the same to my Access form... I really don't know how to write codes, I dont know why it is not working in Access, Please help.. Here is my code that I used in excel userform. Thanks

Sub filter ()
Dim n As Integer
Dim k
Dim dic As Object
Set dic = CreateObject("scripting.dictionary")
dic.CompareMode = vbTextCompare
For n = 1 To 15
dic(Me.Controls("TextBox" & n).Object.Value) = Empty
Next n
n = 0
For Each k In dic.Keys
n = n + 1
Me.Controls("ResultsTxt" & n).Object.Value = k
Next k
k = 0
End Sub
 

Users who are viewing this thread

Back
Top Bottom