Results 1 to 5 of 5
  1. #1
    cap.zadi is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    May 2011
    Location
    KSA
    Posts
    481

    Ctrl the Row.Source of Cbo at Subform from Cbo at MainForm!


    Hi,

    Regarding the subject; The row source of sub-form is controlled by the after update of main form CBo and the below code works fantastic but bit slower and shall press Esc while changing the item in Cbo at main form.

    Is there any better and faster solution?

    Code:
    Private Sub CboEquipment_AfterUpdate()
     Dim strSQL                As String
    
    
        strSQL = "SELECT ItemID, ItemCode, TechnicalName, InstalledQty " _
               & "FROM TblItemMaster " _
               & "WHERE EquID = " & Me.CboEquipment
    
    
    
    
        Me.SFrmSPChange.Form.CboSParts.RowSource = strSQL
    End Sub

  2. #2
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    How many items are in tblItemMaster?
    Is the EquID field indexed ?

    How slow is slow?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    cap.zadi is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Well, It wold have right now 40/50 items and related to equipment means the spare part items only 20.

    The EquID is the PK of its own table equipments and whereas FK to TblItemMaster for assigning to spare parts only.

    Is not due to having main form afterupdate event for users and timestamp recording?

  4. #4
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Quote Originally Posted by cap.zadi View Post
    Is not due to having main form afterupdate event for users and timestamp recording?
    If you are performing other steps then probably yes - simply setting the rowsource of a combo is pretty quick normally.

    You could use a timer to record the various intervals in between your steps in VBA and simply output them to the immediate window using Debug statements to see where the delay is.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    cap.zadi is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Hi

    Thanks. lets Try.

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

Similar Threads

  1. Replies: 8
    Last Post: 10-09-2013, 02:09 AM
  2. Replies: 1
    Last Post: 11-07-2012, 05:31 PM
  3. Replies: 4
    Last Post: 03-30-2012, 01:47 AM
  4. Print reports in a tab ctrl in a tab ctrl
    By marcsessoms in forum Reports
    Replies: 1
    Last Post: 02-18-2012, 12:15 AM
  5. Replies: 1
    Last Post: 11-29-2011, 01:37 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