Using ChemFinder - CambridgeSoft
Using ChemFinder - CambridgeSoft
Using ChemFinder - CambridgeSoft
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 6: Relational Data and<br />
Subforms<br />
Overview<br />
Subforms allow you to work with multiple data<br />
tables in a relational database. You should be<br />
familiar with working with <strong>ChemFinder</strong> forms and<br />
databases before proceeding to subforms.<br />
Accessing Relational<br />
Data <strong>Using</strong> Subforms<br />
A subform is a special box within a form that<br />
behaves like a separate form file. A subform is used<br />
to display information stored within a database, but<br />
it usually displays data from a different database (or<br />
different table within the same database) than the<br />
main form. A subform is usually linked to the main<br />
form, so that retrieval of data in the main form also<br />
retrieves related records in the subform.<br />
Like other types of boxes, you can move select and<br />
resize a subform on the main form. However, you<br />
cannot select it by clicking inside it. You must click<br />
the title bar. When you click inside a subform, you<br />
you activate the miniature form inside the box and<br />
can work within it.<br />
Below are examples of subform use:<br />
• You have data that is associated in a<br />
“one-to-many” relationship. For example, you<br />
want to view a chemical structure together with<br />
its physical properties, stored in a separate<br />
table.<br />
• You are running a stockroom and you want to<br />
store package sizes and prices in the same place<br />
because they are related. Each chemical may be<br />
available in lots of package sizes, and you<br />
wouldn’t want to re-draw the structure every<br />
time you added a new package. You can use a<br />
subform so the physical property information is<br />
entered once in the main form and the package<br />
sizes and prices are entered many times in the<br />
subform.<br />
By linking these two data tables with a linking<br />
field you can make these tables relational; one<br />
table can interact with the other. The contents of<br />
a linking field are not important, as long as they<br />
are different for each record in the main form.<br />
Various forms of ID numbers are often used as<br />
linking fields. As you browse through the main<br />
form, corresponding records in the subform<br />
appear.<br />
Creating a Subform<br />
You create a subform, place form objects on it, and<br />
connect the subform to a database just as you do a<br />
regular form. For detailed information, see<br />
“Chapter 3: Creating and Editing Forms.”<br />
.To create a subform:<br />
1. Click the Subform button .<br />
2. Draw a large box on a form.<br />
A subform appears with a border and scroll<br />
bars.<br />
<strong>ChemFinder</strong> 8 Chapter 6: Relational Data and Subforms • 103<br />
Accessing Relational Data <strong>Using</strong> Subforms