Results 1 to 4 of 4
  1. #1
    masoud_sedighy is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Posts
    78

    navigate records on the form is slow

    i am using a form like form customer orders in northwind 2003 database. in my form there are 3 sub forms.



    data of subform1 will be filtered by one of the field in the main form.
    subform2 will be filtered by one of the field in the subform1 and ...

    also i have added some code for highlighting current row of each form/sub form , now my problem is when navigate thorough records of main form by using navigation button , showing each record after pressing navigation button is a bit slow (it takes 5 seconds), i do not know what is the problem, and i do know how to solve the problem, problem is from subforms or codes for highlighting current row? it is usual?

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    There are lots of ways this can happen, usually because the design isn't taking into account the order in which Access does things.

    If the code is set up to do things in the wrong order, the database may end up having to query its result set several times before it actually displays anything.
    If you post the database, or the code, then we might have something more concrete to say about your methods. (Do not post any *sensitive* data, though.)

  3. #3
    masoud_sedighy is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Posts
    78

    post data base for navigate records on the form is slow

    thanks, i attached my database. the main form is (frmItem_Details_new3).
    Attached Files Attached Files

  4. #4
    masoud_sedighy is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Posts
    78
    In the main form there are 3 subforms
    1-fsubtask
    2-fsubfin
    3-fsubpunchlist

    I have used below code for highlight current row in datasheet view of subform (fsubtask) and also requery below subform (fsubfin)
    Me.Parent![fsubFIN].Requery
    Everything seems ok when I look at on one record in the main form when I use navigate buttons for going thorough other records it is a bit slow, for the test I deleted on current event , the speed was ok but the problem is I do not have highlighted current row and no requery of data in the below subform when select each record at the top form.
    Conditional formatting: ([Rank]=[TxtRef]) Or (Fn_NewRec()=True And [Rank] Is Null)


    Private Sub Form_Current()
    On Error GoTo ErrTrap
    ' Assign row number to Rank (bound control)
    ' - if not a new record (This check is meant to
    ' prevent inadvertant adding of fresh records
    ' merely by navigating to a new record)
    If Me.NewRecord = False Then
    Me.Rank = Me.CurrentRecord
    End If

    ' Assign current record nmber to TxtRef
    Me.TxtRef = Me.CurrentRecord

    ' This statement is necessary for clean
    ' display of color highlights (clearing up
    ' hangover of previous highlights - if any)
    Me.Recalc

    ' Note - TxtRef is an unbond text box in
    ' form header or footer, while Rank
    ' is a bound text box holding row number.

    ' The following expression is used for
    ' highlighting the current row through
    ' conditional formatting:
    ' ([Rank]=[TxtRef]) Or _
    ' (Fn_NewRec()=True And [Rank] Is Null)
    Me.Parent![fsubFIN].Requery

    ExitPoint:
    On Error GoTo 0
    Exit Sub

    ErrTrap:
    MsgBox Err.Number & " - " & Err.Description
    Resume ExitPoint
    End Sub


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

Similar Threads

  1. Replies: 9
    Last Post: 08-07-2012, 11:50 AM
  2. Replies: 1
    Last Post: 03-30-2012, 11:57 PM
  3. Buttons on form to navigate through records
    By emilyrogers in forum Forms
    Replies: 2
    Last Post: 07-19-2011, 10:17 AM
  4. VBA to Navigate form
    By asmith in forum Access
    Replies: 3
    Last Post: 09-30-2010, 11:37 AM
  5. Replies: 2
    Last Post: 03-25-2010, 12:11 PM

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