1 2 3 4 Previous Next 46 Replies Latest reply on Apr 30, 2009 10:21 AM by Bauke

    Input form problems from a newbie

    Bauke

      Title

      Input form problems from a newbie

      Post

      On an inputform the user can choose a date. Based on that choosen date there are several fields in the rest of the form that can be calculated.
      The w_seizoen = If(Month ( w_datum ) < 8; Year ( w_datum )-1  & "/" & Right(Year ( w_datum );2) ; Year ( w_datum ) & "/" & Right(Year ( w_datum )-1;2))
      and I have made it a calculated field.
      The next field is w_wnr. With SQL I would: SELECT MAX(w_wnr) + 1 WHERE w_seizoen = MAX(w_seizoen)

      So based on the w_seizoen (already calculated) the w_wnr should get the highist w_wnr +1

      Besides that the data in the form may not be changed except through a button. What is the best way do do this? Scripts (will be my first); One New button and one Change button? How can I open this form always with a new record?

      I (being new to FMP) surely could use some help here.
      Hope it is clear enough.

      Bauke






        • 1. Re: Input form problems from a newbie
          philmodjunk
            

          It sounds like w_wnr should be set as a serial number field that automatically increments with each new record.

           

          Choose Manage | Database

          Locate the field definition for w_wnr and double click it to bring up the options dialog

          Select the auto-enter tab and select the serial number option

           

          "How can I open this form always with a new record?"

          The simplest approach with a script:

           

          Go To Layout [YourDataEntryForm]

          New Record/Request

           

          Attach this script to a button and place it on any layout where you want the user to be able to bring up the data entry form.

          • 2. Re: Input form problems from a newbie
            Bauke
              

            Hello and thanks for your answer.

             

            Its a bit more complicated than: "It sounds like w_wnr should be set as a serial number field that automatically increments with each new record."

            It also depends on w_seizoen. For every w_seizoen there is a range of w_wnr (from 1 to xxx). Beside that it is possible to get holes in the range with an autoincrement field.

             

            I, of course, will try the script, thanks

             

            Bauke 

            • 3. Re: Input form problems from a newbie
              philmodjunk
                

              Bauke wrote:

              Its a bit more complicated than: "It sounds like w_wnr should be set as a serial number field that automatically increments with each new record."

              It also depends on w_seizoen. For every w_seizoen there is a range of w_wnr (from 1 to xxx). Beside that it is possible to get holes in the range with an autoincrement field.


              If you define relationships correctly, you can set an auto-enter by calculation option that assigns Max(relatedtableoccurrence::w_wnr) + 1 to w_wnr.

              Alternatively, you can create a script to use the same expression to assign a correctly incremented value.


              • 4. Re: Input form problems from a newbie
                Bauke
                  

                Thanks Phil,

                 

                I tried the first option. When I use this nothing shows.

                When I make a global field (volgende_wedstrijd) with the same calc. (Max(wedstrijden 2::w_wnr) + 1) and change the calc. in the w_wnr to the field volgende_wedstrijd the new value shows in the inputform. But only the first new record. Adding another record gives me the old value (1 to less)

                 

                I must be doing something wronghere, but i don't know where.

                 

                If you need more info, please let me know

                 

                Bauke

                • 5. Re: Input form problems from a newbie
                  philmodjunk
                    

                  I'm forgetting the basic table and relationship structure here. Before I can help figure this out, I'll need a quick refresher on the tables and relationships involved. I and another forum user worked out a similar problem and I still have the demo DB I set up to figure it out. I need to compare structures to see if that trick will work in you case also.

                   

                  • 6. Re: Input form problems from a newbie
                    Bauke
                      

                    Thanks,

                    Here are a few screenshots. First the relations:

                     

                     Then the tables in the database:

                     The fields in the most important table:

                     and the inputform with which I have more than one problem. In browse mode its fine; inserting a new record gives problems. Not only with the wedstrijdnr (w_wnr), but also with saving the first 5 items and the 7 items on the right side as the second record to save.

                     

                     Bauke

                    • 7. Re: Input form problems from a newbie
                      philmodjunk
                        

                      Thanks,

                       

                      The difference in languages does add to the challenge here. As I said in an earlier post, "if you have the right relationship..."

                       

                      "For every w_seizoen there is a range of w_wnr, 1... xxx"  to do this automatically you need an additional relationship. I can't read the language so I may be misunderstanding the purpose of some of your tables but here's what will do the job, you can change names to suit your purposes:

                       

                      Go to manage | database | Relationships

                       

                      Click on w_seizoen in the Wedstrijden table occurrence, drag it out and back to the same field to create a new TO linked solely by the w_seizoen field.

                       

                      Name this new TO, "SameTeam".

                       

                      Click the Fields tab and set the auto enter by calculation options for w_wnr as follows:

                       

                      Type in If (IsEmpty(SameTeam::w_wnr); 0; Max(SameTeam::w_wnr)) + 1

                      If the "Do not replace existing value..." check box is selected, de-select it

                       

                       

                      Click OK as many times as you need to return to the layout and test.

                      • 8. Re: Input form problems from a newbie
                        Bauke
                          

                        Thanks again Phil, it works!

                         

                        Maybe if I translate some things it will be easier for you to see the purpose of the tables:

                         

                        Wedstrijden - Games.

                        A game is played by two players (w_speler) and for every game, player there should be a record. Every year we play from september till july (w_seizoen) and we play different types of games (w_ronde). To make it fair games, every player has a calculated handicap (w_temaken (table moyenne)) for every type (w_ronde).

                         

                        Leden - Players.

                        One record for every player with adresses and the first- and last season they are members.

                         

                        Moyenne - Handicap.

                        One record for every combination of w_speler, w_seizoen and w_ronde (player, season and game-type) calculated on the result of the previous season.

                         

                        Ronde - Types of games, with a long and short description.

                         

                        Systeem - System.

                        Every game has a maximum number of turns for each player. This can change once a season. There is also a minimum handicap based on the max number of turns in a game. All in this table.

                         

                        Standen - The players position in the competition for every week played.

                         

                        Hope this makes it a bit clearer!

                         

                        Then the following problem I have. As you can see in my inputform I have to fill in data for two records (speler (player)) at the time. I think I have to use scripts to save these two records, but I don't know how yet. It would be nice to have an example.

                         

                        Thanks in advance,

                         

                        Bauke

                        • 9. Re: Input form problems from a newbie
                          philmodjunk
                            

                          With translated terms in hand, I printed out your examples and took a closer look. There's a relationship that looks like it won't work for you. You have two occurences of Wedstrijden linked by 5 pairs of fields with the "X" (cross product) symbol. This makes no sense. The "X" symbol means: "match every record in table 1 with every record in table 2 regardless of what values are stored in the key fields." This type of relationship can be very useful, but you don't normally match multiple fields with it as you get the same results whether you have one pair of match fields or several.

                           

                          I think you need to eliminate the entire lower half of your relationships graph, (all the table occurences that end in "2) exept for Wedstrijden 2. I would modify its relationship to use "=" and to match w_datum, w_seizoen, w_ronde, w_wnr, but NOT by w_speler (player) enable the create related records option for the second occurence. This "self join" should be used to identify all players of the same specific Game.

                           

                          I don't see anything in your sample input form that can't be handled through, menus, relationships and auto-entry settings.

                           

                          Do you know how to create portals?

                           

                          I'd make the right hand column of fields for player two a portal that refers to Wedstrijden 2. That step alone would automate much of the data entry process.

                          • 10. Re: Input form problems from a newbie
                            Bauke
                              

                            Thanks very much Phil,

                             

                            I tried to make a portal but I can't seem to get the fields positioned like in the inputform.

                             

                            The X relation I had was equal for the fields you said and a not equal for the player. So wedstrijden would give me player1 and wedstrijden 2 would give me player 2. Why is that not needed. how else will I get player 2 in the right lower half of the inputform?

                             

                            I read something about a book "FileMaker Pro 10, the missing manual". You know it? I need to know more about the FMP relations and scripting and maybe this book is just what I need.

                             

                            Thanks again

                             

                            Bauke

                            • 11. Re: Input form problems from a newbie
                              philmodjunk
                                

                              "I tried to make a portal but I can't seem to get the fields positioned like in the inputform."

                              I thought this might make it easier to set up for you. You can also just add the fields to the form, but refer to the self Join table occurrence, wedstrijden 2, instead of Wedstrijden.

                               

                              "The X relation I had was equal for the fields you said and a not equal for the player. So wedstrijden would give me player1 and wedstrijden 2 would give me player 2. Why is that not needed. how else will I get player 2 in the right lower half of the inputform?"

                              Interesting, I hadn't considered using "=" for some fields and "x" for others in the same relationship. In any case the "x" relation is a "Match all" symbol. If you were to delete the player ID pair that you've linked with "x", I think you'll get the same function and that should match what I've suggested in a previous post. THus you don't have to change this unless you simply want to make the relationship a little less complicated in its appearance. The other "2" table occurrences should not be needed as you can get to those records via the relationships between Wedstrijden and the other TOs for the same table.

                               

                              I read something about a book "FileMaker Pro 10, the missing manual". You know it? I need to know more about the FMP relations and scripting and maybe this book is just what I need.

                              All I know about it is that other forum members have mentioned it. Whenever I go shopping for a tech manual, I look it up on a site like Amazon and read the reader reviews.

                               

                              Good luck. It's been fun.

                               

                              • 12. Re: Input form problems from a newbie
                                Bauke
                                  

                                Thanks again Phil,

                                 

                                I'm still working on it. Will be back here, no doubt about that.

                                 

                                And indeed, it's fun learning this.

                                 

                                Bauke

                                • 13. Re: Input form problems from a newbie
                                  Bauke
                                    

                                  Hello,

                                   

                                  Phil, I tried it. With the x relation for speler I get the right things in browse mode, but I cannot enter anything in wedstrijden2 . Without it everything is weird (calculation is wrong and the names in blue are wrong).

                                   

                                  I'm stuck here. You need my file to get a closer look? Tell me how to sen d it to you.

                                   

                                  Bauke  

                                  • 14. Re: Input form problems from a newbie
                                    philmodjunk
                                      

                                    Let's check a few details first:

                                     

                                    Are wedstrijden and wedstrijden 2 two occurences of the SAME table (which is what I've assumed) or completely separate tables?

                                     

                                    Please confirm or correct my assumptions about the following fields:

                                     

                                    w_datum (date field, date game will be played)

                                    w_seizoen (text or calculation that returns text, season such as 2008/09)

                                    w_ronde (number or text that identifies type of game)

                                    w_wnr (number that identifies game sequence within a given season)

                                    w_speler (number that uniquely identifies one player record in leden and one handicap record in moyenne)

                                     

                                    From our earlier discussion of assigning values to w_wnr, (for every instance of w_seizoen, there are 1...xxx values for w_wnr), it looks like there should be only two records in wedstrijden, (one for each player) for any given combination of w_seizoen and w_wnr. (Say game #5 of the 2008/09 season, for example.)

                                     

                                    Tell me where I'm misunderstanding things first.

                                    1 2 3 4 Previous Next