Tabbed Forms

2 Nov 00

Cfw.exe version 7.0131


Tabbed forms is a new feature in ChemFinder 7 which improves data browsing efficiency.  When viewing a large form, you no longer need to scroll around to see it all — you can divide the form into sections, and bring each one up by clicking a tab.  You no longer have to shrink the structure box to see all the data!  As an example, here’s a more manageable form for ISI_Demo:




Subforms can have tabs too, like little Rolodexes of detail relating to the main record:




Each tab can be shown in its own view — form or table. As you move from one tab to another, you might see a grid of one type of data, boxes of another.


In developing the tabs feature, we overhauled the mechanism for switching between form and table views, and fixed a series of bugs which came to the surface.  For example, dividing a form into tabs involves copying and pasting boxes from one tab to another, but this has never worked for subform boxes.  It now does.  In ChemFinder 7, copying a subform box copies the box and all its contents, including database connections and link fields.




While the tabbed form feature is easy to use, it is intended for advanced users and form builders.  To the casual user, it is invisible.  New forms and existing formfiles look and act just as they always have — tabs do not come into play until they are created.


Tab information is saved in the formfile, so the file format changes as of this version.  In general this means that .cfw files saved from ChemFinder 7 will not be readable by earlier versions.  However, we’ve minimized the impact of this by the following trick:  if you are working with a form which has no tabs, and you save it, it is saved as the previous version (readable by ChemFinder 6); only if the form has tabs is it saved as the new version.


To create tabs on a form:


  1. Open an existing form or create a new one. 


  1. Right-click an open space on the form (not on a box) to get the form popup menu. You’ll see three new commands: Add Tab, Delete Tab, and Rename Tab.  The latter are dimmed since you do not yet have any tabs.



  1. Choose Add Tab.  The scrollbar changes to show the new tab(s).  The form you were viewing becomes Tab 1, the active tab.


Note:  When you add a tab to a form which has none, it actually creates two tabs, one for the current form, and another blank one underneath it.  The currently active tab does not change when you add a new tab.


  1. To use the new tab, click it.  Tab 2 becomes active, the drawing space becomes blank, and you may draw boxes as on any other form.  Any boxes you draw on a tab are visible only when that tab is active.


Note: All boxes you draw on the new tab work just as if you had drawn them on the main form — they all connect to the same recordset, all stay in synch as you browse.  Changing between tabs simply shows and hides boxes.  If you want different tabs to connect to different data sources, you can do this with subforms (see below).


Note:  You may create as many tabs as you like, but currently there is no mechanism for scrolling through the set of tabs shown in the window frame.  Therefore, if you have more tabs than will fit in the window alongside the scrollbar, some are inaccessible.


To create tabs on a subform:


  1. Open a form having a subform, or create a new subform box on a form.


  1. Click within the subform box to activate it.


  1. Right-click and proceed as above.


Note:  In a subform box, you may choose whether or not to display scrollbars.  In a subform box with scrollbars off, creating a tab changes this setting and shows the scrollbars (so you can see the tabs).  You may turn them off again, but you won’t be able to manipulate the tabs while scrollbars are invisible.


To edit tabs:


Once you have tabs on a form, right-click on a tab to see the little popup menu shown below.  Alternatively, to edit the currently-active tab, you may right-click directly on the form and use the standard form popup menu shown above.



  1. To delete a tab, right-click on it and choose Delete Tab.  The tab is removed.  If it was the active tab, a different one becomes active.


Note:  When you delete a tab, all boxes on it are deleted.  An alert warns about this and allows you to cancel.  Exception: if a form has only one tab, and you delete it, no boxes are deleted — the form simply reverts to a regular form with no tabs.


  1. To rename a tab, right-click on it and choose Rename Tab.  You will be prompted to supply the new tab name.  There are no restrictions on what you name a tab, but we recommend you use something short.


About views


A new tab, like a new document, is in form view, for creating boxes and viewing one record at a time.  Once you have connected the form to a database and drawn at least one box containing data, you may switch it into table view, and/or bring up table view in a separate window.  The interface for these operations has not changed from previous versions, but there are some new considerations involving tabs.


Note: In addition to form and table views, we have other views in mind for the future: “subform view,” which would allow each tab to connect to a different table (currently you can achieve a similar result by drawing a subform box within a tab, as described below); or “continuous-scroll view” in which you scroll through a stack of mini-forms.


To change views:


  1. Open a form, or create one, connect it to a database, and draw some boxes.


  1. Do one of the following:  choose Switch Views from the View menu; press ctl-W; click the Switch Views button ; if a subform is active, double-click inside it, or choose Data Table from the View menu.


Form view changes to table view, or vice-versa, and scrolls to the current record.  If you switch to table view within a tab, the table displays only the data visible on that tab. [At the moment there is a bug: once you have created a table view for a tab, it is not re-created as boxes on the tab are added and deleted.  We’re fixing this.]


The view you choose in a tabbed form is a property of the tab.  Bringing up a tab will display the view in which the tab was last seen.  This information is saved in the formfile.  [Bug: at the moment you cannot switch the main tab to table view and save this state, but only because File Save is not available from table view.  We’re fixing this.]


Note:  In table view, some menu commands are unavailable.  For example, you cannot choose Search Enter Query from table view.  You must switch back to form view to access these commands.  [At the moment, there are several commands which ought to be available from table view but are not.  We’re fixing this.]


  1. If a main form (not a subform) is active:  choose Data Table from the View menu, or press ctl-T.


A separate window appears containing the table view, allowing you to view both form and table at the same time.  If the table view is already showing, choose View Data Table to hide it.


Note: it is now possible for the first time to have two table views on screen at the same time.  From a tabbed form, use View Data Table to bring up the table window, then go back to the form and select a tab showing table view.  For example:


Both windows stay in synch as you browse in either.  [Note that some window-title bugs arise in this situation.]



Viewing different tables within a subform box


A common need is to display several tables of data relating to a single main record.  Until now this has been done by putting multiple subforms on a main form.  In ChemFinder 7, tabbed subforms allow this to be done more compactly, but the process is a little cumbersome.  For now, each tab of a tabbed subform box needs to contain its own subform.


Say you want a main form showing structures from cs_demo, and a tabbed subform showing in one tab the synonyms for each structure (from the cs_demo synonyms table), and in another, test results (from some table in another database which has a numeric ID column).


  1. Create a form, connect it to cs_demo.mdb / MolTable, draw some boxes and assign them fields.
  2. Draw a large subform box.  It will be automatically entitled “MolTable.”  (We’ll call this the “outer subform.”)
  3. Right-click the header of the subform box, and choose MOL_ID.  This will link the subform to the main form.
  4. Right-click inside the subform box and choose Add Tab.
  5. Rename the tabs: Tab1 → Synonyms, Tab2 → Test Results.
  6. With the Synonyms tab active, draw a subform box as large as the tab (the “inner subform”).  It will be entitled “MolTable” and will have scrollbars.
  7. Right-click on the header of the inner subform box, choose Properties, uncheck “With title” and “With scroll bars”, and click OK.  The inner subform becomes a simple box.
  8. Right-click inside the inner subform and choose Data Source.  Select the Synonyms table and click OK.
  9. Draw two boxes in the inner subform.  Right-click on one and select SYN_ID, on the other select Synonym.  The boxes should fill with the values “1” and “Benzene.”  What you have should now look about like this:



  1. Right-click the inner subform header and choose MOL_ID.  This will link the MOL_ID of the outer subform to the SYN_ID of the inner.  The main form is now linked to the outer subform, and that to the inner subform.
  2. Double-click inside the inner subform.  The synonyms subform changes to table view, showing a list of synonyms for the current structure.
  3. Click anywhere in the outermost main form to select it.  Verify that as you browse the structures, the synonym values change accordingly.
  4. Click the Test Results tab.  The synonyms tab becomes hidden, and the outer subform becomes blank. 
  5. Repeat steps 6-11 to create an inner subform connected to the test results table:  draw an inner subform, connect it to the test results table, link it to the MOL_ID of the outer subform, switch it to table view.



  1. Right-click the header of the outer subform, choose Properties, and uncheck “With title.”  This will suppress the inaccurate title “MolTable.”
  2. Voila!  With some luck, you have a compact, functioning device.  As you browse to a structure, you can flip back and forth between its subtable of synonyms and its table of test results.
  3. Choose your favorite tab, then save the form.  Whichever tab of the subform is in front when the file is saved will become active when the file is read.


Bugs, notes, loose ends