Friday, June 17, 2011

New Sample: Form_SynchronizedSubforms

By A.D. Tejpal

This sample db demonstrates synchronized scrolling of two subforms (both in datasheet view).

Two modes are covered:
    (a) One way synchronization: Top subform always functions as the master while the other one serves as the slave.
    (b) Two way synchronization: Whichever subform happens to be the active one, functions as the master while the other one serves as the slave.

Note: For ready identification, the subform currently serving as the slave, has a darker back color as compared to the master.

For each of the above modes, three alternative styles of scroll synchronization are demonstrated:
    (a) Synchronize horizontal scroll only.
    (b) Synchronize vertical scroll only.
    (c) Synchronize both horizontal and vertical scroll.

Sample data depicts student's scores in phase 1 (top subform) and phase 2 (bottom subform). For each student, wherever the scores in these two subform happen to differ, the same get highlighted as follows:
    (a) Top subform: Light grey.
    (b) Bottom subform: If value is greater than that in other subform, it gets highlighted in light green. On the other hand, if value is less than that in other subform, it gets highlighted in light pink.

Note: The above highlights get suitably updated promptly on editing of data in either of the two subforms.

Version:  Access 2000 File Format

You can find the sample here:
http://www.rogersaccesslibrary.com/forum/Form-synchronizedsubforms_topic566.html

5 comments:

Anonymous said...

Roger-

This reminds me of a problem I am trying to solve, as I try to build a very simple business requirements traceability matrix. I will be brief here, in the case that I am going about this incorrectly.

I have built tables that will accept data for 9 projects. Each project can list 9 high level requirements, each of those can list 9 child requirements, and so on, to four levels below the project. My form looks like an organizational chart that shows the parent requirement at the top and the 9 child requirements below. I want to be able to move horizontally and vertically, for example, to click on the child and it then moves to parent position and shows its 9 child requirements.

Currently, the child fields are a subform. When the parent ID reads "1.0," the child fields should read "1.1, 1.2, 1.3, 1.4," and so on. If I change parent to "2.0," the child fields should read "2.1, 2.2," and so on. They do not do that, I'm just stuck. Not sure if my tables are even set up right.

One could set up such an apparatus in microsoft project if the flow chart blocks would accept custom fields. Current microsoft traceability matrices do not provide a satisfactory graphical user interface; and they are the only sofware tools I am allowed to use. Can you advise?

Roger's Access Blog said...

This isn't the best venue for this type of question. I suggest asking it at Utter Access (www.utteraccess.com), which is one of the best web forums devoted to Access. It requires you to register, but it's free.

Jason Walter said...

I am looking to customize this code to use on a form containing three subforms instead of just two. Is this adaptation difficult? I am developing a database for a non-profit that is trying to get up and running but I have somewhat limited programming experience. I have done my best to customize the code in your example but I can't seem to make things work correctly. Any help would be greatly appreciated

Roger's Access Blog said...

@Jason

Questions regarding the sample should be directed to its author, which in this case is A.D. Tejpal at Email: adtp@airtelmail.in

Jason Walter said...

Thank you for your response. I'll fire off an e-mail. Have a great day.