Results 1 to 2 of 2
  1. #1
    DMetcalfe92 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    1

    Search too SLOW :(

    Hey Guys,
    I built an asset register for the company I work for in MS Access.
    Everything worked fine, until we recently migrated to SQL. We use ODBC links to the SQL tables and use the access DB as a front end

    The searching of a SQL table is painfully slow. it takes between 5 and 15 seconds to return a record


    Code is below:

    Code:
    Private Sub Hardware_Search_AfterUpdate()
    DoCmd.OpenForm "frm_Hardware_Database", acNormal
    
    Dim x As Long
    x = DCount("*", "Assets_tbl_Asset_Database", "[AssetID] = '" & Me.[Hardware_Search] & "'")
    If x > 0 Then
    DoCmd.FindRecord (Me.[Hardware_Search]), acAnywhere, , , , acAll
    DoCmd.Close acForm, "Search_Asset_ID"
    Else
    MsgBox "No Record Found"
    DoCmd.Close acForm, "Search_Asset_ID"
    DoCmd.Close acForm, "frm_Daisy_Hardware_Database"
    DoCmd.OpenForm "Switchboard", acNormal
    End If
    
    End Sub

    I've pinpointed the slowness to DoCmd.FindRecord (Me.[Hardware_Search]), acAnywhere, , , , acAll
    I'm not sure why it's so slow to find a record, I just get Calculating . . . in the bottom left hand corner for a long time.


    I've come up with a different method which should be instant:

    Find the record ID form the table, and then execute the following code.
    DoCmd.GoToRecord acDataForm, "frm_Hardware_Database", acGoTo, record_id




    My only issue is finding the record ID!!! I've been searching for about an hour on the internet and can't find anything!
    Does anyone have a quick fix?
    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Instead of opening the form with all records, how about opening it with this technique after testing if a record exists?

    BaldyWeb wherecondition
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. What to do when a split DB is slow?
    By Datech in forum Access
    Replies: 5
    Last Post: 06-07-2012, 07:03 PM
  2. Slow Over Network
    By dnelson33 in forum Access
    Replies: 4
    Last Post: 02-07-2012, 10:34 AM
  3. Printing is slow
    By mikew in forum Access
    Replies: 2
    Last Post: 11-04-2011, 11:52 AM
  4. Slow Database
    By cadsvc in forum Database Design
    Replies: 3
    Last Post: 05-31-2011, 09:48 AM
  5. Slow Search
    By ggarza75 in forum Forms
    Replies: 1
    Last Post: 02-18-2011, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums