Mreis Posted May 13, 2009 Posted May 13, 2009 Hello, I've created a tab field in the records and every time I push "new record", the cursor jumps to the last tab written (they are 3 tabs)...how can I change it so that when I press "new record" the cursor goes to the first tab?
mr_vodka Posted May 13, 2009 Posted May 13, 2009 Well you can script the new record creation with a go to object step. You can either use a button to call teh script or since you have advanced, you can just use custom menus to override the native new record step.
Mreis Posted May 13, 2009 Author Posted May 13, 2009 wow Mr Vodka you are my replier for all posts.... ok...but can you tell me (step by step) how can I do it ("script the new record creation with a go to object step.") Very much appreciated
tv_kid Posted May 13, 2009 Posted May 13, 2009 I may be misunderstanding, but it sounds as if you are trying to set the default tab panel, which is done in the 'Tab Control Setup' dialog ('Default Front Tab'). Hope this helps
Mreis Posted May 13, 2009 Author Posted May 13, 2009 (edited) well...that is done from the beginning but still, everytime I had a new record, the first tab appearing is the last one visited... : Edited May 13, 2009 by Guest
tv_kid Posted May 13, 2009 Posted May 13, 2009 Ok, I misunderstood. So how about an 'On Record Load' trigger on the layout that calls a 'Go to Object' script that selects the correct tab panel?
Mreis Posted May 13, 2009 Author Posted May 13, 2009 that could be.....but (and because a a newbie) how do I do it? :
tv_kid Posted May 13, 2009 Posted May 13, 2009 First ensure that your tab has an object name: Select the tab (the individual pane, not the whole panel) Ensure the 'Obejct Info' pallette is available Type a name for the tab Then create a script: Go to Object [Object Name: "name you gave the tab"] In Layout Setup, click on 'Script Triggers' Check the 'OnRecordLoad' box and select the script you just created. Now, whenever a record loads (not just when a new record is created), the script will run and switch to the correct tab. Hope this helps
Mreis Posted May 13, 2009 Author Posted May 13, 2009 ...something must be wrong. I've done was tv_kid told and did not worked. :
mr_vodka Posted May 13, 2009 Posted May 13, 2009 I didnt suggest using a script trigger because you only wanted it on a new record, not whenever a record is changed. You have advanced so I think you should use a custom menu. Using a script trigger I think may be overkill. Try this... 1. Go to your tab panel and name each one of the tab objects in your "Object Info" Pallette a. Let's say we call them Tab1, Tab2, Tab3, etc. 2. Create a script that does the following: New Record Go to Object ["Tab1"] 3. Go to the following menus: Tools --> Custom menu --> manage custom menus 4. Click the Custom Menus tab a. Select the 'Records Copy' custom menu and click duplicate b. Rename 'Records Copy2' to whatever you want to call it c. Edit it and select the "New Record" Menu Item d. Click the 'Action' checkbox and leave it on "Script" e. Specify the script name that you created f. Hit okay to all the menus and get out of it 5. Click the Menu Sets tab a. The deault loads with 2 menus sets. [standard FileMaker Menus] and Custom Menu Set 1 b. Select Custom Menu Set 1 and click duplicate c. Rename'Custom Menu Set 1 Copy' to whatever you want to call it d. Select the 'Records Copy' item and move over the Renamed 'Records Copy2' to add it e. Hit okay to all the menus and get out of it 6. Select the Layout that you want to apply the custom menu to a. GO into layout mode b. Under "Layout setup", choose the new menu set that you created c. Hit okay d. Go back into browse mode.
tv_kid Posted May 13, 2009 Posted May 13, 2009 I agree that it could be overkill to use a script trigger. For the sake of completeness however, attached is a file that uses a script trigger. To ensure it only has any effect on new records, I've put in a check to see if the record has just been created. Therefore it will not adjust the tab if you navigate to a record that already exists. Hope this helps. Tab_Panel.fp7.zip
Recommended Posts
This topic is 5673 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now