My tables are (all names ends with _table, but to lazy to write it here)
Acccess = hold login and user data for the ppl that use the database
BussA = hold log rows about students application of a buss-card.
BussElev = hold student names and data
cloth = hold data about work-cloth
clothA = hold data about who uses a specific garment
IT = hold data about IT products, computers, ipads etc.
ITA = hold data about who owns are are using an IT product.
ITLog = hold log rows about each IT product
key = hold data about keys and access-cards
keyA = hold data about who have a key signed to them
LonFor =holds data about specific ppl´s contracts that are split up between different bank accounts
paste errors = something access created a long time ago.... holds two rows of data in two columns
profile = hold data about staff-memembers names, contracts, start and end dates etc.
profilelog = hold log rows connected to each staff member.
undervisningtid = hold data about specific contracts and those peoples work-time
one process that are very slow is when i search for a person.
i have a form containing one textbox and one listbox.
listbox is populated for example with IT products or staff-members
when i type in the textbox i search in the listbox and filter down to what i am searching for.
this is the code, this was Instant before and is more or less instant when using VPN or on local machine. But at work it takes 5-10 seconds to search
this code is placed in an "*******" for a search-button.
Code:
Private Sub SOK_Click()
Application.Echo False
Me.txtSearch.SetFocus
Dim strSource As String
strSource = "SELECT KeyOwnerSelect_Query.Key_ID, KeyOwnerSelect_Query.Nyckel_Kort_Nummer, KeyOwnerSelect_Query.Nyckeltyp, KeyOwnerSelect_Query.LasSystem, KeyOwnerSelect_Query.Profile_ID_SK, KeyOwnerSelect_Query.Firstname, KeyOwnerSelect_Query.Lastname, KeyOwnerSelect_Query.KeyArchived " & _
"FROM KeyOwnerSelect_Query " & _
"Where (KeyOwnerSelect_Query.Key_ID Like '*" & Me.txtSearch.Text & "*' " _
& "Or Nyckel_Kort_Nummer Like '*" & Me.txtSearch.Text & "*' " _
& "Or Nyckeltyp Like '*" & Me.txtSearch.Text & "*' " _
& "Or LasSystem Like '*" & Me.txtSearch.Text & "*' " _
& "Or Profile_ID_SK Like '*" & Me.txtSearch.Text & "*' " _
& "Or Firstname Like '*" & Me.txtSearch.Text & "*' " _
& "Or Lastname Like '*" & Me.txtSearch.Text & "*') AND KeyArchived is null "
Me.ListPicker.RowSource = strSource
Me.ListPicker.Requery
Application.Echo True
End Sub
Since the code have worked so fast before i cant see why it now is slow.
My largest table contains 1500 rows and it is the profiles log table. Each profile/staff have a log where we keep track on vacation/sick or other things... maybe this log table have grown to big?
after that it is the log table about IT products where we log on each product what repairs and other things, it have about 900 rows and after that it is quite far for the next table with about 300 etc.