Hi everyone! I am working on a simple skill matrix Access database for our organization. In a few places I came across a need to have an editable pivot view in the forms for many-to-many relationships. One example. I have the following tables: tbl_skills (id, skill_name), tbl_roles(id, role_name), tbl_map_roles_to_skils (id, role_id, skill_id). What I would like to have is like a matrix view with skills as rows, roles as columns and a checkbox in every intersection. I can create this view with a crosstab query, but it's obviously not editable. I have come across this blog post: https://alisadev.blogspot.com/2009/06/how-to-fake-editable-crosstab-in.html describing how to achieve the same with programmatically laying out the UI elements using VBA. My question - is it possible to achieve same/similar functionality without lots of VBA coding? Are there any design patterns for Access that I can utilize?
Thanks!
Kevin Yip
@Reply 3 months ago
Crosstab queries aren't meant to be editable because they have aggregate fields (fields that use Sum(), Max(), Min(), etc.). An aggregate field obtains data from multiple records, and that's why you can't change its value. Excel has PivotTable, which is the equivalent of crosstab query, and it is also not editable. If you must have an editable grid-like form, then its data cannot be bound to any Access table. You need to work with completely unbound data, and you need to maintain data integrity (preserving primary key, enforcing validation, etc.) on your own. And that's why you need VBA, and probably lots of it. You need to catch every conceivable data entry error because Access won't do it for you -- the user can enter data wily-nily in a setup like this. My advice is forget this, and set up a normalized way to do data entry to make it more manageable.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visitor Forum.