Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Location
    Nashville, TN
    Posts
    3

    Question Unanswered: Simulating an enum field

    I'm a newbie to FMP6, so I hope I haven't missed the answer when searching.

    I want a field that holds a serial number but displays as a text string. For example, the field Students:course contains an ID number relating to a record in Courses:courseID, but displays as Courses:courseName. [Hopefully my pseudo-syntax is clear? Database:fieldName]

    In edit mode, Student:course should produce a pop-up list or menu of all Courses:courseName, and plug the corresponding Courses:courseID. In display mode, it should display Courses:courseName based on the courseID that's actually stored.

    I know about creating dynamic value lists for formatting that would display ID and text together, but once the choice is made, the ID displays.

    I'm sure this is a common problem, and I hope I've described it sufficiently to jog memories. I don't want to rely on courseName itself as a relational key, since it should be editable without breaking existing relationships.

    Thanks so much,
    Chap

  2. #2
    Join Date
    May 2004
    Location
    Melbourne, Australia
    Posts
    23
    Hello Chap,
    You want to establish your relationships based on ID values, but you want to see the relevant (and meaningful) text description on screen rather than the ID.

    The most common way to achieve this in FileMaker 6 is to place the Students::CourseID field and the Courses::CourseName field on the layout and turn off the option to 'allow entry into field' for the latter, then stack them with the Courses::CourseName field in front of the Students::CourseID field. That way when you click or tab you will go into the Students::CourseID field (ie to edit it) and it will pop to the front, temporarily obscuring the course name, but as soon as you leave the field, it will drop back behind the Courses::CourseName field, so the name (from the related courses record) will be what is seen.
    -------------------
    Ray
    FileMaker Developer
    http://www.nightwing.com.au/FileMaker

  3. #3
    Join Date
    Jul 2004
    Location
    Nashville, TN
    Posts
    3
    Ray,
    Thanks for your reply. I eventually came up with that solution (only I paired the CourseID and CourseName in the pop-up menu). I was originally hoping to prevent the CourseID from *ever* being visible, but this isn't bad since the IDs are fixed-length and line up nicely on the left of the pop-up menu where they're easier to ignore.
    Neat trick. Nice to know this is the right way to do it!
    Chap

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •