Jump to content
Sign in to follow this  
Mreis

Some Help with tabing

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 by Guest

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

that could be.....but (and because a a newbie) how do I do it? :

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

...something must be wrong.

I've done was tv_kid told and did not worked. :

Share this post


Link to post
Share on other sites

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. 



Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.