Hi!
I'm currently working on app(s) with Access FE linked to SQL Server BE. SQL Server has scheduled Job's which will read read data from various ERP systems of various sites, converts read data to unified structure, and stores converted data to tables in SQL database. In Access FE, users will register various requests and articles/products requested. And FE must display various information about those articles/products from SQL database.
I had performance problems with one of forms, which displays a list of components for all articles/products registered for request. When I did give out a version of app for testing, they registered some 25000 articles for single request, and as result this form updated about 10 minutes, and then for half of cases the app crashed. So I have now spent some time to redesigning the database to avoid something like this happening again. I splitted previous SQL database to databases per site (as FE will work with single site data anyway), and stored as much as possible of data previously calculated in FE form RecordSource queries into BE tables (as those will be updated on daily shedule out of worktime, and the time spent for calculating this info there is minuscle compared with rest of Job time). But maybe someone has additional ideas to make this form more efficient. Until now I have made apps having massive amount of data only for reporting.
The form has RecordSource like
Code:
SELECT DISTINCTreq.SiteCode, req.ReqID, cmp.CompArtNo, cmp.CompArtTyp, cmp.CompArtName, cmp.CompArtCode, cmp.CompArtCategory, cmp.CompArtAccount,
cmp.CompArtAccAlias, cmp.CompArtUnit, cmp.CompArtOrign, cmp.CompArtEU, cmp.CompCurrSupplCode, cmp.CompCurrSupplAlias,
cmp.CompCurrSupplAccGroup, cmp.CompCurrSupplArtNo, cmp.CompCurrProducer, cmp.CompArtStatus
FROM (tRequests AS req LEFT JOIN tReqProducts AS prod ON req.ReqID = prod.ReqID) LEFT JOIN tProdComponents AS cmp ON prod.ProdArtNo = cmp.ProdArtNo
WHERE (((cmp.CompArtNo) Is Not Null));
Data entry, additions, deletions, etc. for form are disabled. The form is continuous subform of requests form. The same component may belong to articles/products sold to several customers registered in request, but the unique list of components per request is needed - so SELECT DISTINCT is used.
And now my questions:
1. Not all of fields returned have controls in form. Do those fields affect perfomance?
2. Some of returned fields have comboboxes as controls in form, and read info from other tables (e.g. combobox cbbCompArtStatus is linked to field CompArtStatus, but dispalys the according value from tArtStatuses.ArtStatusText). Is this the efficient, or is there a reason to add field CompArtStatusText to table tProdComponents, and instead of combo use a text box linked to this field?
3. What is better way to get unique list of components - using SELECT DISTINCT, or using an aggregate query (e.g. counting customers for component) instead?
4. I mentioned before, only some fields in form's RecordSource are linked to controls. Unitl now I have an additional single form beside this one, where additional fields (which were left out) for active component are displayed, but this takes a lot of room (and affects apps performance). I have considered some different solutions, but I have no experience with them. So is there any reason to prefer:
4a) A popup form displaying additional fields (or whole list of fields, as probably it will block at least part of original form), activated from button on form;
4b) A Message box displaying additional/all fields, activated from button on form;
4c) Maybe there is some way to display additional info when the cursor is hovering over some control in form, I'm not aware of (but probably it doesn't exist)?