MajP
You've got your good things, and you've got mine.
- Local time
- Yesterday, 22:09
- Joined
- May 21, 2018
- Messages
- 8,922
I added a demo of a Large From to List with about 10K available. But no issue doing any size. As set up I would think no problem handling a several 100k you would need to slightly modify the code once you get into the millions so that you never go over the 60k limit. It is a combination of a FAYT and a From to list. So you can filter as you like on the left side and select your records. Then you can search as needed on something else. In this example the left list starts blank then returns all words with "A" then "A" then "AAR".
If you list gets into the millions then you will have to be more restrictive. You will have to force the user to provide a minimum amount of letters to search. Here it starts after just one letter.
There is really almost no new code to make this work. I had to hard wire the search and the update and delete queries.
This is pretty much the whole code that needs to be touched, everything else is in the class module. You initialize the class and code the delete and update queries.
If you list gets into the millions then you will have to be more restrictive. You will have to force the user to provide a minimum amount of letters to search. Here it starts after just one letter.
There is really almost no new code to make this work. I had to hard wire the search and the update and delete queries.
This is pretty much the whole code that needs to be touched, everything else is in the class module. You initialize the class and code the delete and update queries.
Code:
Public WithEvents FormFromTo As Form_FromToListLarge
Private Sub Form_Load()
Set FormFromTo = Me.subform_FromToList.Form
Dim FromSQL As String
Dim ToSQL As String
FromSQL = "SELECT tbldata.PersonID, Full_Name FROM tblData where True = false"
ToSQL = "SELECT tbldata.PersonID, Full_Name FROM tblData inner JOIN tblSelectedData ON tblData.PersonID = tblSelectedData.PersonID ORDER BY tblData.Full_Name"
FormFromTo.FTL_InitializeFromTo FromSQL, ToSQL, "People Not Selected", "People Selected", True
End Sub
Private Sub FormFromTo_ItemFromAdded(Item As Variant)
Dim strSql As String
strSql = "Delete * from tblSelectedData where PersonID = " & Item
CurrentDb.Execute strSql
FormFromTo.ListFrom.Requery
FormFromTo.ListTo.Requery
End Sub
Private Sub FormFromTo_ItemToAdded(Item As Variant)
Dim strSql As String
strSql = "Insert into tblSelectedData (PersonID) VALUES (" & Item & ")"
CurrentDb.Execute strSql
FormFromTo.ListTo.Requery
FormFromTo.ListFrom.Requery
End Sub