sql server - MS Access - Pass Through query best practice solution -
so have particular situation here crm i'm tasked developing, , i'd see if can insight on more of sanctioned, best-practice approach specific scenario. basically, have form called accounts displays information specific account subform needs display quotes , orders associated account give user snapshot of work done.
due complexity of query , number of possible records, scrolling through subform can slow if using sql view or more obviously, local access query. best solution here pass through query can shoot processing straight sql.
i've done quite bit of research , best approach i've seen either 1) use vba change definition of pass through query or 2) use insert statement populate local table can used recordsource subform. @ point want confirm either or both of these approaches qualify best practice situation , possibly example of code make happen. right i'm struggling processing belongs. don't want call code subform launches main accounts form since form can opened few different places , don't want duplicate code.
here code i'm using copy dataset pass through query local table , using master/child relationship fields show appropriate data account.
dim db dao.database dim strsql string set db = currentdb 'purge local table pass through results copied strsql = "delete * tblpassthruresults" db.execute strsql 'insert results of pass through query local table strsql = "insert tblpassthruresults select q_account_business_overview_pt.* q_account_business_overview_pt" db.execute strsql db.close set db = nothing
Comments
Post a Comment