https://neowiki.neooffice.org/index.php?title=Adding_a_Button_To_Open_Another_Form&action=history&feed=atomAdding a Button To Open Another Form - Revision history2024-03-29T15:33:11ZRevision history for this page on the wikiMediaWiki 1.10.1https://neowiki.neooffice.org/index.php?title=Adding_a_Button_To_Open_Another_Form&diff=13865&oldid=prevLorinda: /* Create The Necessary Macros */ fix line break issue with macro2008-06-03T17:44:59Z<p><span class="autocomment">Create The Necessary Macros -</span> fix line break issue with macro</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 17:44, 3 June 2008</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 39:</strong></td>
<td colspan="2" align="left"><strong>Line 39:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">REM Macro to open specific form called 'Locations Data Entry'. One is needed for each form you wish to open from another form.</td><td>+</td><td style="background: #cfc; font-size: smaller;">REM Macro to open specific form called 'Locations Data Entry'. </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">REM </ins>One <ins style="color: red; font-weight: bold; text-decoration: none;">Macro </ins>is needed for each form you wish to open from another form.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">sub OpenForm_Locations_Data_Entry( oev as variant )</td><td> </td><td style="background: #eee; font-size: smaller;">sub OpenForm_Locations_Data_Entry( oev as variant )</td></tr>
</table>Lorindahttps://neowiki.neooffice.org/index.php?title=Adding_a_Button_To_Open_Another_Form&diff=13824&oldid=prevLJ-Bettona: typo corrections -in Refreshing 4 and 102008-05-07T19:14:57Z<p>typo corrections -in Refreshing 4 and 10</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 19:14, 7 May 2008</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 88:</strong></td>
<td colspan="2" align="left"><strong>Line 88:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Under the {{Menu|Tools}} menu, choose {{Menu|Macros}} then {{Menu|Organize}} and finally {{Menu|NeoOffice Basic...}}</td><td> </td><td style="background: #eee; font-size: smaller;"># Under the {{Menu|Tools}} menu, choose {{Menu|Macros}} then {{Menu|Organize}} and finally {{Menu|NeoOffice Basic...}}</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Select the Library and Module where you want the macro to be stored. See [[Using Macros]] article for more information on how to do this. </td><td> </td><td style="background: #eee; font-size: smaller;"># Select the Library and Module where you want the macro to be stored. See [[Using Macros]] article for more information on how to do this. </td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">#:If you store the macro in the Form, the macro will be transfered if you move the database file to another computer, but everytime you open the form, you will receive a warning about the document containing macros. If you will be using the file on only one computer, you can avoid this warning message by saving the macro in one of the libraries in the '''My Macros''' area. It is <del style="color: red; font-weight: bold; text-decoration: none;">reccommended </del>that you '''not''' save macros to the Standard library, as that library is easily overwritten. The [[Using Macros]] article includes information on creating new libraries and modules.</td><td>+</td><td style="background: #cfc; font-size: smaller;">#:If you store the macro in the Form, the macro will be transfered if you move the database file to another computer, but everytime you open the form, you will receive a warning about the document containing macros. If you will be using the file on only one computer, you can avoid this warning message by saving the macro in one of the libraries in the '''My Macros''' area. It is <ins style="color: red; font-weight: bold; text-decoration: none;">recommended </ins>that you '''not''' save macros to the Standard library, as that library is easily overwritten. The [[Using Macros]] article includes information on creating new libraries and modules.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click the {{Button|Edit}} button.</td><td> </td><td style="background: #eee; font-size: smaller;"># Click the {{Button|Edit}} button.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click after the words <tt>End Sub</tt> and hit {{Key|Return}} a couple of times</td><td> </td><td style="background: #eee; font-size: smaller;"># Click after the words <tt>End Sub</tt> and hit {{Key|Return}} a couple of times</td></tr>
<tr><td colspan="2" align="left"><strong>Line 109:</strong></td>
<td colspan="2" align="left"><strong>Line 109:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click the save icon on the Toolbar</td><td> </td><td style="background: #eee; font-size: smaller;"># Click the save icon on the Toolbar</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Close the {{Window|Macro}} window</td><td> </td><td style="background: #eee; font-size: smaller;"># Close the {{Window|Macro}} window</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"># Right-click or control-click on any form control in the '''Locations Data Entry''' form and choose {{Menu|Form...}} from the contextual <del style="color: red; font-weight: bold; text-decoration: none;">mene</del>.</td><td>+</td><td style="background: #cfc; font-size: smaller;"># Right-click or control-click on any form control in the '''Locations Data Entry''' form and choose {{Menu|Form...}} from the contextual <ins style="color: red; font-weight: bold; text-decoration: none;">menu</ins>.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Section|Events}} tab</td><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Section|Events}} tab</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Button|...}} button to the right of the {{prefName|After record change}} field</td><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Button|...}} button to the right of the {{prefName|After record change}} field</td></tr>
</table>LJ-Bettonahttps://neowiki.neooffice.org/index.php?title=Adding_a_Button_To_Open_Another_Form&diff=13785&oldid=prevLorinda: /* Refreshing the Combo Box Contents */ add note about limitation here2008-04-25T19:08:30Z<p><span class="autocomment">Refreshing the Combo Box Contents -</span> add note about limitation here</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 19:08, 25 April 2008</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 76:</strong></td>
<td colspan="2" align="left"><strong>Line 76:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==Refreshing the Combo Box Contents==</td><td> </td><td style="background: #eee; font-size: smaller;">==Refreshing the Combo Box Contents==</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">At this point, the button on the '''Field Trips Data Entry''' form will open the '''Locations Data Entry''' form, and the user can then enter the data for the new location. But if you return to the '''Field Trips Data Entry''' form, the new location will not show up in the Combo Box. <del style="color: red; font-weight: bold; text-decoration: none;">There are at least two ways to approach this. For our purposes, we </del>will add a macro to the '''Locations Data Entry''' form to force the refresh of the Combo Box on the '''Field Trips Data Entry''' form after a new record has been entered in the '''Locations Data Entry''' form.</td><td>+</td><td style="background: #cfc; font-size: smaller;">At this point, the button on the '''Field Trips Data Entry''' form will open the '''Locations Data Entry''' form, and the user can then enter the data for the new location. But if you return to the '''Field Trips Data Entry''' form, the new location will not show up in the Combo Box. <ins style="color: red; font-weight: bold; text-decoration: none;">We </ins>will add a macro to the '''Locations Data Entry''' form to force the refresh of the Combo Box on the '''Field Trips Data Entry''' form after a new record has been entered in the '''Locations Data Entry''' form.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># First we must make a note of the name of the form and the combo box control that must be refreshed.</td><td> </td><td style="background: #eee; font-size: smaller;"># First we must make a note of the name of the form and the combo box control that must be refreshed.</td></tr>
<tr><td colspan="2" align="left"><strong>Line 82:</strong></td>
<td colspan="2" align="left"><strong>Line 82:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">## Right-click or control click on the '''Locations''' drop-down control and select {{Menu|Form...}} from the contextual menu.</td><td> </td><td style="background: #eee; font-size: smaller;">## Right-click or control click on the '''Locations''' drop-down control and select {{Menu|Form...}} from the contextual menu.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">## Make a note of the name entered in the {{prefName|Name}} field of the {{Section|General}} tab of the {{Window|Form Properties}} window and then close the window.</td><td> </td><td style="background: #eee; font-size: smaller;">## Make a note of the name entered in the {{prefName|Name}} field of the {{Section|General}} tab of the {{Window|Form Properties}} window and then close the window.</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">## Right-click or control on the '''Locations''' drop-<del style="color: red; font-weight: bold; text-decoration: none;">cown </del>control again and this time select {{Menu|Control...}} from the contextual menu.</td><td>+</td><td style="background: #cfc; font-size: smaller;">## Right-click or control on the '''Locations''' drop-<ins style="color: red; font-weight: bold; text-decoration: none;">down </ins>control again and this time select {{Menu|Control...}} from the contextual menu.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">## Make a note of the name entered in the {{prefName|Name}} field of the {{Section|General}} tab of the {{Window|Properties:Combo Box}} window and then close the window.</td><td> </td><td style="background: #eee; font-size: smaller;">## Make a note of the name entered in the {{prefName|Name}} field of the {{Section|General}} tab of the {{Window|Properties:Combo Box}} window and then close the window.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">#:'''Note''' you can also check the names of the form and controls by activating the Form Navigator.</td><td> </td><td style="background: #eee; font-size: smaller;">#:'''Note''' you can also check the names of the form and controls by activating the Form Navigator.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Open the '''Locations Data Entry''' for editing. (Right click or control click on its icon and choose {{Menu|Edit}})</td><td> </td><td style="background: #eee; font-size: smaller;"># Open the '''Locations Data Entry''' for editing. (Right click or control click on its icon and choose {{Menu|Edit}})</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Under the {{Menu|Tools}} menu, choose {{Menu|Macros}} then {{Menu|Organize}} and finally {{Menu|NeoOffice Basic...}}</td><td> </td><td style="background: #eee; font-size: smaller;"># Under the {{Menu|Tools}} menu, choose {{Menu|Macros}} then {{Menu|Organize}} and finally {{Menu|NeoOffice Basic...}}</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"># Select the Library and Module where you want the macro to be stored. See [[Using Macros]] article for more information on how to do this. <del style="color: red; font-weight: bold; text-decoration: none;">Click the {{Button|Edit}}</del></td><td>+</td><td style="background: #cfc; font-size: smaller;"># Select the Library and Module where you want the macro to be stored. See [[Using Macros]] article for more information on how to do this. </td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">#:If you store the macro in the Form, the macro will be transfered if you move the database file to another computer, but everytime you open the form, you will receive a warning about the document containing macros. If you will be using the file on only one computer, you can avoid this warning message by saving the macro in one of the libraries in the '''My Macros''' area. It is reccommended that you '''not''' save macros to the Standard library, as that library is easily overwritten. The [[Using Macros]] article includes information on creating new libraries and modules.</td><td> </td><td style="background: #eee; font-size: smaller;">#:If you store the macro in the Form, the macro will be transfered if you move the database file to another computer, but everytime you open the form, you will receive a warning about the document containing macros. If you will be using the file on only one computer, you can avoid this warning message by saving the macro in one of the libraries in the '''My Macros''' area. It is reccommended that you '''not''' save macros to the Standard library, as that library is easily overwritten. The [[Using Macros]] article includes information on creating new libraries and modules.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click the {{Button|Edit}} button.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click after the words <tt>End Sub</tt> and hit {{Key|Return}} a couple of times</td><td> </td><td style="background: #eee; font-size: smaller;"># Click after the words <tt>End Sub</tt> and hit {{Key|Return}} a couple of times</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"># Paste in the following code, replacing any <del style="color: red; font-weight: bold; text-decoration: none;">instaces </del>of <tt>FieldTripsInfo</tt> with the name of your form and any instances of <tt><del style="color: red; font-weight: bold; text-decoration: none;">Location</del><tt> with the name of your combo box. Make sure to retain the double quotes around the form and control names</td><td>+</td><td style="background: #cfc; font-size: smaller;"># Paste in the following code, replacing any <ins style="color: red; font-weight: bold; text-decoration: none;">instances </ins>of <tt>FieldTripsInfo</tt> with the name of your form and any instances of <tt><ins style="color: red; font-weight: bold; text-decoration: none;">cbxLocation</ins><<ins style="color: red; font-weight: bold; text-decoration: none;">/</ins>tt> with the name of your combo box. Make sure to retain the double quotes around the form and control names</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">#:{{preBox|<nowiki></td><td> </td><td style="background: #eee; font-size: smaller;">#:{{preBox|<nowiki></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">Sub Refresh_Field_Trips_Data_Entry_Form</td><td> </td><td style="background: #eee; font-size: smaller;">Sub Refresh_Field_Trips_Data_Entry_Form</td></tr>
<tr><td colspan="2" align="left"><strong>Line 99:</strong></td>
<td colspan="2" align="left"><strong>Line 100:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> if not IsNull(tmp.Component) then</td><td> </td><td style="background: #eee; font-size: smaller;"> if not IsNull(tmp.Component) then</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> tmp = tmp.Component.DrawPage.Forms.getByName("FieldTripsInfo")</td><td> </td><td style="background: #eee; font-size: smaller;"> tmp = tmp.Component.DrawPage.Forms.getByName("FieldTripsInfo")</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> if tmp.HasByName("<del style="color: red; font-weight: bold; text-decoration: none;">Location</del>") then </td><td>+</td><td style="background: #cfc; font-size: smaller;"> if tmp.HasByName("<ins style="color: red; font-weight: bold; text-decoration: none;">cbxLocation</ins>") then </td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> tmp.getByName("<del style="color: red; font-weight: bold; text-decoration: none;">Location</del>").refresh</td><td>+</td><td style="background: #cfc; font-size: smaller;"> tmp.getByName("<ins style="color: red; font-weight: bold; text-decoration: none;">cbxLocation</ins>").refresh</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> endif</td><td> </td><td style="background: #eee; font-size: smaller;"> endif</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"> endif</td><td> </td><td style="background: #eee; font-size: smaller;"> endif</td></tr>
<tr><td colspan="2" align="left"><strong>Line 117:</strong></td>
<td colspan="2" align="left"><strong>Line 118:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Close the {{Window|Form Properties}}</td><td> </td><td style="background: #eee; font-size: smaller;"># Close the {{Window|Form Properties}}</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Test the macro by adding a new field trip to the '''Field Trips Data Entry''' form and using the {{Button|New Location}} button to enter a new location.</td><td> </td><td style="background: #eee; font-size: smaller;"># Test the macro by adding a new field trip to the '''Field Trips Data Entry''' form and using the {{Button|New Location}} button to enter a new location.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">#:'''Note''' In my testing, I found this only worked correctly if I typed in the name of the location in the '''Location''' combo box before clicking on the {{Button|New Location}} button. If I left the location field empty, I saw an error dialog box on returning to the '''Field Trips Data Entry''' form and the combo box drop down was not updated with the new location.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==External Links==</td><td> </td><td style="background: #eee; font-size: smaller;">==External Links==</td></tr>
</table>Lorindahttps://neowiki.neooffice.org/index.php?title=Adding_a_Button_To_Open_Another_Form&diff=13784&oldid=prevLorinda: /* External Links */ add link2008-04-25T18:55:43Z<p><span class="autocomment">External Links -</span> add link</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 18:55, 25 April 2008</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 119:</strong></td>
<td colspan="2" align="left"><strong>Line 119:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==External Links==</td><td> </td><td style="background: #eee; font-size: smaller;">==External Links==</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">[http://www.oooforum.org/forum/viewtopic.phtml?t=37999&postdays=0&postorder=asc&start=0 OOo Forums thread on <del style="color: red; font-weight: bold; text-decoration: none;">this topic</del>]</td><td>+</td><td style="background: #cfc; font-size: smaller;">[http://www.oooforum.org/forum/viewtopic.phtml?t=37999&postdays=0&postorder=asc&start=0 OOo Forums thread on <ins style="color: red; font-weight: bold; text-decoration: none;">macros needed for button]<br></ins></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">[http://user.services.openoffice.org/en/forum/viewtopic.php?f=13&t=3619&p=23822#p23822 OOCF Forum thread on macro needed to refresh form</ins>]</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">{{botlangbarEN|[[Fr:Ajouter un Bouton pour Ouvrir un Autre Formulaire |Français]]}}</td><td> </td><td style="background: #eee; font-size: smaller;">{{botlangbarEN|[[Fr:Ajouter un Bouton pour Ouvrir un Autre Formulaire |Français]]}}</td></tr>
</table>Lorindahttps://neowiki.neooffice.org/index.php?title=Adding_a_Button_To_Open_Another_Form&diff=13782&oldid=prevLorinda: /* Refreshing the Combo Box Contents */ continue working on this section2008-04-25T17:52:50Z<p><span class="autocomment">Refreshing the Combo Box Contents -</span> continue working on this section</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 17:52, 25 April 2008</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 78:</strong></td>
<td colspan="2" align="left"><strong>Line 78:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">At this point, the button on the '''Field Trips Data Entry''' form will open the '''Locations Data Entry''' form, and the user can then enter the data for the new location. But if you return to the '''Field Trips Data Entry''' form, the new location will not show up in the Combo Box. There are at least two ways to approach this. For our purposes, we will add a macro to the '''Locations Data Entry''' form to force the refresh of the Combo Box on the '''Field Trips Data Entry''' form after a new record has been entered in the '''Locations Data Entry''' form.</td><td> </td><td style="background: #eee; font-size: smaller;">At this point, the button on the '''Field Trips Data Entry''' form will open the '''Locations Data Entry''' form, and the user can then enter the data for the new location. But if you return to the '''Field Trips Data Entry''' form, the new location will not show up in the Combo Box. There are at least two ways to approach this. For our purposes, we will add a macro to the '''Locations Data Entry''' form to force the refresh of the Combo Box on the '''Field Trips Data Entry''' form after a new record has been entered in the '''Locations Data Entry''' form.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"># Open the '''Field Trips Data Entry''' form for editing (Right click or control click on its icon and choose {{Menu|Edit}})</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"># First we must make a note of the name of the form and the combo box control that must be refreshed.</ins></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"># Right-click or control click on the '''Locations''' drop-down control a</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">#</ins>#Open the '''Field Trips Data Entry''' form for editing (Right click or control click on its icon and choose {{Menu|Edit}})</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">#</ins># Right-click or control click on the '''Locations''' drop-down control <ins style="color: red; font-weight: bold; text-decoration: none;">and select {{Menu|Form...}} from the contextual menu.</ins></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">## Make </ins>a <ins style="color: red; font-weight: bold; text-decoration: none;">note of the name entered in the {{prefName|Name}} field of the {{Section|General}} tab of the {{Window|Form Properties}} window and then close the window.</ins></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">## Right-click or control on the '''Locations''' drop-cown control again and this time select {{Menu|Control...}} from the contextual menu.</ins></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">## Make a note of the name entered in the {{prefName|Name}} field of the {{Section|General}} tab of the {{Window|Properties:Combo Box}} window and then close the window.</ins></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">#:'''Note''' you can also check the names of the form and controls by activating the Form Navigator.</ins></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Open the '''Locations Data Entry''' for editing. (Right click or control click on its icon and choose {{Menu|Edit}})</td><td> </td><td style="background: #eee; font-size: smaller;"># Open the '''Locations Data Entry''' for editing. (Right click or control click on its icon and choose {{Menu|Edit}})</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Under the {{Menu|Tools}} menu, choose {{Menu|Macros}} then {{Menu|Organize}} and finally {{Menu|NeoOffice Basic...}}</td><td> </td><td style="background: #eee; font-size: smaller;"># Under the {{Menu|Tools}} menu, choose {{Menu|Macros}} then {{Menu|Organize}} and finally {{Menu|NeoOffice Basic...}}</td></tr>
<tr><td colspan="2" align="left"><strong>Line 85:</strong></td>
<td colspan="2" align="left"><strong>Line 90:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">#:If you store the macro in the Form, the macro will be transfered if you move the database file to another computer, but everytime you open the form, you will receive a warning about the document containing macros. If you will be using the file on only one computer, you can avoid this warning message by saving the macro in one of the libraries in the '''My Macros''' area. It is reccommended that you '''not''' save macros to the Standard library, as that library is easily overwritten. The [[Using Macros]] article includes information on creating new libraries and modules.</td><td> </td><td style="background: #eee; font-size: smaller;">#:If you store the macro in the Form, the macro will be transfered if you move the database file to another computer, but everytime you open the form, you will receive a warning about the document containing macros. If you will be using the file on only one computer, you can avoid this warning message by saving the macro in one of the libraries in the '''My Macros''' area. It is reccommended that you '''not''' save macros to the Standard library, as that library is easily overwritten. The [[Using Macros]] article includes information on creating new libraries and modules.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click after the words <tt>End Sub</tt> and hit {{Key|Return}} a couple of times</td><td> </td><td style="background: #eee; font-size: smaller;"># Click after the words <tt>End Sub</tt> and hit {{Key|Return}} a couple of times</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"># Paste in the following code<del style="color: red; font-weight: bold; text-decoration: none;">:</del></td><td>+</td><td style="background: #cfc; font-size: smaller;"># Paste in the following code<ins style="color: red; font-weight: bold; text-decoration: none;">, replacing any instaces of <tt>FieldTripsInfo</tt> with the name of your form and any instances of <tt>Location<tt> with the name of your combo box. Make sure to retain the double quotes around the form and control names</ins></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">{{preBox|<nowiki></td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;">#:</ins>{{preBox|<nowiki></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">Sub Refresh_Field_Trips_Data_Entry_Form</td><td> </td><td style="background: #eee; font-size: smaller;">Sub Refresh_Field_Trips_Data_Entry_Form</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">Dim tmp as Object </td><td> </td><td style="background: #eee; font-size: smaller;">Dim tmp as Object </td></tr>
<tr><td colspan="2" align="left"><strong>Line 101:</strong></td>
<td colspan="2" align="left"><strong>Line 106:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">End Sub</td><td> </td><td style="background: #eee; font-size: smaller;">End Sub</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></nowiki>}}</td><td> </td><td style="background: #eee; font-size: smaller;"></nowiki>}}</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click the save icon on the Toolbar</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Close the {{Window|Macro}} window</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Right-click or control-click on any form control in the '''Locations Data Entry''' form and choose {{Menu|Form...}} from the contextual mene.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click on the {{Section|Events}} tab</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click on the {{Button|...}} button to the right of the {{prefName|After record change}} field</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># In the {{Window|Assign Action}} window, make sure the {{prefName|After record change}} is still selected and click on the {{Button|Macro}}</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Use the disclosure triangles to drill down through the libraries and modules in the {{Section|Library}} column until you reach the module where the new macro is stored.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># In the {{Section|Macro name}} column, select the name of the new macro ('''Refresh_Field_Trips_Data_Entry_Form''')</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click {{Button|OK}}</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Close the {{Window|Form Properties}}</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Test the macro by adding a new field trip to the '''Field Trips Data Entry''' form and using the {{Button|New Location}} button to enter a new location.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==External Links==</td><td> </td><td style="background: #eee; font-size: smaller;">==External Links==</td></tr>
</table>Lorindahttps://neowiki.neooffice.org/index.php?title=Adding_a_Button_To_Open_Another_Form&diff=13780&oldid=prevLorinda: /* External Links */ add section on a new macro--it's not done yet.2008-04-25T17:05:00Z<p><span class="autocomment">External Links -</span> add section on a new macro--it's not done yet.</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 17:05, 25 April 2008</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 74:</strong></td>
<td colspan="2" align="left"><strong>Line 74:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Button|Design Mode On/Off}} button (the blue drafting triangle)</td><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Button|Design Mode On/Off}} button (the blue drafting triangle)</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click on the newly made button, and verify that the '''Locations Data Entry''' form opens.</td><td> </td><td style="background: #eee; font-size: smaller;"># Click on the newly made button, and verify that the '''Locations Data Entry''' form opens.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">==Refreshing the Combo Box Contents==</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">At this point, the button on the '''Field Trips Data Entry''' form will open the '''Locations Data Entry''' form, and the user can then enter the data for the new location. But if you return to the '''Field Trips Data Entry''' form, the new location will not show up in the Combo Box. There are at least two ways to approach this. For our purposes, we will add a macro to the '''Locations Data Entry''' form to force the refresh of the Combo Box on the '''Field Trips Data Entry''' form after a new record has been entered in the '''Locations Data Entry''' form.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Open the '''Field Trips Data Entry''' form for editing (Right click or control click on its icon and choose {{Menu|Edit}})</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Right-click or control click on the '''Locations''' drop-down control a</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Open the '''Locations Data Entry''' for editing. (Right click or control click on its icon and choose {{Menu|Edit}})</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Under the {{Menu|Tools}} menu, choose {{Menu|Macros}} then {{Menu|Organize}} and finally {{Menu|NeoOffice Basic...}}</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Select the Library and Module where you want the macro to be stored. See [[Using Macros]] article for more information on how to do this. Click the {{Button|Edit}}</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">#:If you store the macro in the Form, the macro will be transfered if you move the database file to another computer, but everytime you open the form, you will receive a warning about the document containing macros. If you will be using the file on only one computer, you can avoid this warning message by saving the macro in one of the libraries in the '''My Macros''' area. It is reccommended that you '''not''' save macros to the Standard library, as that library is easily overwritten. The [[Using Macros]] article includes information on creating new libraries and modules.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click after the words <tt>End Sub</tt> and hit {{Key|Return}} a couple of times</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Paste in the following code:</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">{{preBox|<nowiki></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">Sub Refresh_Field_Trips_Data_Entry_Form</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">Dim tmp as Object </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> tmp = thisComponent.Parent.FormDocuments</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> if tmp.HasByName("FieldTripsInfo") then </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> tmp = tmp.getByName("FieldTripsInfo")</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> if not IsNull(tmp.Component) then</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> tmp = tmp.Component.DrawPage.Forms.getByName("FieldTripsInfo")</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> if tmp.HasByName("Location") then </td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> tmp.getByName("Location").refresh</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> endif</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> endif</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"> endif</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">End Sub</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></nowiki>}}</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">==External Links==</td><td> </td><td style="background: #eee; font-size: smaller;">==External Links==</td></tr>
</table>Lorindahttps://neowiki.neooffice.org/index.php?title=Adding_a_Button_To_Open_Another_Form&diff=13533&oldid=prevLJ-Bettona: /* Create The Necessary Macros */ flippy typo, a to an typo2008-03-13T17:59:41Z<p><span class="autocomment">Create The Necessary Macros -</span> flippy typo, a to an typo</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 17:59, 13 March 2008</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 10:</strong></td>
<td colspan="2" align="left"><strong>Line 10:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Under the {{Menu|Tools}} menu, choose {{Menu|Macros}}, then {{Menu|Organize Macros}} and finally {{Menu|NeoOffice Basic}}</td><td> </td><td style="background: #eee; font-size: smaller;"># Under the {{Menu|Tools}} menu, choose {{Menu|Macros}}, then {{Menu|Organize Macros}} and finally {{Menu|NeoOffice Basic}}</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click the {{Button|Organizer}} button</td><td> </td><td style="background: #eee; font-size: smaller;"># Click the {{Button|Organizer}} button</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"># Click on the <del style="color: red; font-weight: bold; text-decoration: none;">flipply </del>triangle to the left of the document icon named {{prefName|Field Trips Data Entry}}</td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click on the <ins style="color: red; font-weight: bold; text-decoration: none;">flippy </ins>triangle to the left of the document icon named {{prefName|Field Trips Data Entry}}</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click on the folder icon named {{prefName|Standard}} that appears</td><td> </td><td style="background: #eee; font-size: smaller;"># Click on the folder icon named {{prefName|Standard}} that appears</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click the {{Button|New}} button; the {{Window|New Module}} window appears.</td><td> </td><td style="background: #eee; font-size: smaller;"># Click the {{Button|New}} button; the {{Window|New Module}} window appears.</td></tr>
<tr><td colspan="2" align="left"><strong>Line 46:</strong></td>
<td colspan="2" align="left"><strong>Line 46:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">end sub</nowiki>}}</td><td> </td><td style="background: #eee; font-size: smaller;">end sub</nowiki>}}</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">#:''--> Note: code under '''REM Generic macros needed to open any form''' only needs to be entered once in the Module. If you add buttons to open other forms later, all you need to do is copy the code under '''REM Macro to open specific form''' and change the names in the first two lines to reflect the form you want opened. In the first line (that begins sub OpenForm_), you cannot use spaces in naming the macro; you must use underscores instead.''</td><td> </td><td style="background: #eee; font-size: smaller;">#:''--> Note: code under '''REM Generic macros needed to open any form''' only needs to be entered once in the Module. If you add buttons to open other forms later, all you need to do is copy the code under '''REM Macro to open specific form''' and change the names in the first two lines to reflect the form you want opened. In the first line (that begins sub OpenForm_), you cannot use spaces in naming the macro; you must use underscores instead.''</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"># Click on the {{Button|Save}} button on the toolbar (it looks like <del style="color: red; font-weight: bold; text-decoration: none;">a </del>external "floppy" drive)</td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click on the {{Button|Save}} button on the toolbar (it looks like <ins style="color: red; font-weight: bold; text-decoration: none;">an </ins>external "floppy" drive)</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Close the window by clicking on the red circle in the upper left hand corner.</td><td> </td><td style="background: #eee; font-size: smaller;"># Close the window by clicking on the red circle in the upper left hand corner.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">''--> Note: This tutorial has you save this macro in the document. It is possible to save it to a module in "My Macros." But if you copy or move the document to another computer (or another user account), the form will be unable to find the macro that way. Saving the macro in the document insures that it will always be available to the form.''</td><td> </td><td style="background: #eee; font-size: smaller;">''--> Note: This tutorial has you save this macro in the document. It is possible to save it to a module in "My Macros." But if you copy or move the document to another computer (or another user account), the form will be unable to find the macro that way. Saving the macro in the document insures that it will always be available to the form.''</td></tr>
</table>LJ-Bettonahttps://neowiki.neooffice.org/index.php?title=Adding_a_Button_To_Open_Another_Form&diff=13029&oldid=prevLorinda: /* Add the Button */ add link to OOo thread that was source of code2007-12-15T15:02:46Z<p><span class="autocomment">Add the Button -</span> add link to OOo thread that was source of code</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 15:02, 15 December 2007</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 74:</strong></td>
<td colspan="2" align="left"><strong>Line 74:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Button|Design Mode On/Off}} button (the blue drafting triangle)</td><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Button|Design Mode On/Off}} button (the blue drafting triangle)</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click on the newly made button, and verify that the '''Locations Data Entry''' form opens.</td><td> </td><td style="background: #eee; font-size: smaller;"># Click on the newly made button, and verify that the '''Locations Data Entry''' form opens.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">==External Links==</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">[http://www.oooforum.org/forum/viewtopic.phtml?t=37999&postdays=0&postorder=asc&start=0 OOo Forums thread on this topic]</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">{{botlangbarEN|[[Fr:Ajouter un Bouton pour Ouvrir un Autre Formulaire |Français]]}}</td><td> </td><td style="background: #eee; font-size: smaller;">{{botlangbarEN|[[Fr:Ajouter un Bouton pour Ouvrir un Autre Formulaire |Français]]}}</td></tr>
</table>Lorindahttps://neowiki.neooffice.org/index.php?title=Adding_a_Button_To_Open_Another_Form&diff=12151&oldid=prevJgd: botlangbar -> Fr page2007-10-06T08:15:06Z<p>botlangbar -> Fr page</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 08:15, 6 October 2007</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 74:</strong></td>
<td colspan="2" align="left"><strong>Line 74:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Button|Design Mode On/Off}} button (the blue drafting triangle)</td><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Button|Design Mode On/Off}} button (the blue drafting triangle)</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click on the newly made button, and verify that the '''Locations Data Entry''' form opens.</td><td> </td><td style="background: #eee; font-size: smaller;"># Click on the newly made button, and verify that the '''Locations Data Entry''' form opens.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">{{botlangbarEN|[[Fr:Ajouter un Bouton pour Ouvrir un Autre Formulaire |Français]]}}</td></tr>
</table>Jgdhttps://neowiki.neooffice.org/index.php?title=Adding_a_Button_To_Open_Another_Form&diff=12144&oldid=prevLorinda: /* Create The Necessary Macros */ add section on making the button2007-10-05T02:33:11Z<p><span class="autocomment">Create The Necessary Macros -</span> add section on making the button</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 02:33, 5 October 2007</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 47:</strong></td>
<td colspan="2" align="left"><strong>Line 47:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">#:''--> Note: code under '''REM Generic macros needed to open any form''' only needs to be entered once in the Module. If you add buttons to open other forms later, all you need to do is copy the code under '''REM Macro to open specific form''' and change the names in the first two lines to reflect the form you want opened. In the first line (that begins sub OpenForm_), you cannot use spaces in naming the macro; you must use underscores instead.''</td><td> </td><td style="background: #eee; font-size: smaller;">#:''--> Note: code under '''REM Generic macros needed to open any form''' only needs to be entered once in the Module. If you add buttons to open other forms later, all you need to do is copy the code under '''REM Macro to open specific form''' and change the names in the first two lines to reflect the form you want opened. In the first line (that begins sub OpenForm_), you cannot use spaces in naming the macro; you must use underscores instead.''</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Button|Save}} button on the toolbar (it looks like a external "floppy" drive)</td><td> </td><td style="background: #eee; font-size: smaller;"># Click on the {{Button|Save}} button on the toolbar (it looks like a external "floppy" drive)</td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"># Close the <del style="color: red; font-weight: bold; text-decoration: none;">{{Window|My Macros & Dialogs}} </del>window by clicking on the red circle in the upper left hand corner.</td><td>+</td><td style="background: #cfc; font-size: smaller;"># Close the window by clicking on the red circle in the upper left hand corner.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">''--> Note: This tutorial has you save this macro in the document. It is possible to save it to a module in "My Macros." But if you copy or move the document to another computer (or another user account), the form will be unable to find the macro that way. Saving the macro in the document insures that it will always be available to the form.''</td><td> </td><td style="background: #eee; font-size: smaller;">''--> Note: This tutorial has you save this macro in the document. It is possible to save it to a module in "My Macros." But if you copy or move the document to another computer (or another user account), the form will be unable to find the macro that way. Saving the macro in the document insures that it will always be available to the form.''</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">==Add the Button==</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># With the ''Field Trips Data Entry'' form still open, make sure that the form controls toolbar is visible. If it is not, go to the {{Menu|View}} menu and choose {{Menu|Toolbars}} and then {{Menu|Form Controls}}.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click on the {{Button|Push Button}} icon on the Form Controls Toolbar.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Move the mouse to the spot on the form where you want to add the button. I choose to place it near the "Location" label.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click and drag to create the button.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Double-click the button to open the properties window.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Under the {{Section|General}} tab, make the following changes:</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">## Give the button a descriptive {{prefName|Name}}. I called it "Open Location Form"</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">## Give the button a {{prefName|Label}} this will appear on the button. I entered "New Location" (without the quotes)</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">## Set {{prefName|Tabstop}} to "No." This way the button will not be part of the tab order. (leave it at Yes if you want it to be part of the tab order)</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">## Near the bottom, enter some descriptive {{prefName|Help text}}. This will appear as a "tool tip" when you mouse over the button, unless you have such tips turned off.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># In the {{Section|Events}} tab, find the line that says {{prefName|Mouse button pressed...}}. Click the {{Button|...}} button that is to the right of the field box in that same line. The {{Window|Assign Actions}} window opens.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Make sure that {{prefName|Mouse button pressed}} line is selected. If not, select it.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click the {{Button|Macro...}}</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># In the {{Window|Macro Selector}} window, click on the flippy triangle next to the '''Field Trips Data Entry''' document icon.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click on the flippy triangle next to the '''Standard''' folder icon</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click on the '''Button macros''' folder icon</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># In the {{Section|Macro Name}} column, select the macro named '''Open_Form_Locations_Data_Entry'''</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click {{Button|OK}}</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Close the {{Window|Assign Action}} by clicking the {{Button|OK}}</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Close the {{Window|Properties:Button}} window</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click on the {{Button|Design Mode On/Off}} button (the blue drafting triangle)</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"># Click on the newly made button, and verify that the '''Locations Data Entry''' form opens.</td></tr>
</table>Lorinda