1 Reply Latest reply on May 15, 2012 10:00 AM by philmodjunk

    SetFieldID to Suit ValueList

    Tucker

      Title

      SetFieldID to Suit ValueList

      Post

       My database has numerous occurances where the Child table holds the foreign key of the Parent table where an item in the Parent table is further defined by an item in the child table. Example: The EventTask table is joined to it's child table called Event. The join is as follows: EventTask::__pkEventTaskID -->Event::_fkEventTaskID.

      The parent table also contains a field called TaskType where various tasks are listed in text form. In the Parent table (Event),  I use a valuelist that the field _fkEventTaskID uses in a popup control. The valuelist uses value  __pkEventTask from the first field and EventTaskType from the second field. I only display values from the second field.

      In one instance I need to set the _fkEventTask (in the child table) to match an item in the value list. I wish to use the SetField method. How do I script this to select a valuelist item? Or should I set the field to the number (as per the __pkEventTaskID) that corresponds to the selection I wish to get?

      Thanks

        • 1. Re: SetFieldID to Suit ValueList
          philmodjunk

          EventTask::__pkEventTaskID----<Event::_fkEventTaskID

          The EventTask table is joined to it's child table called Event.

          In the Parent table (Event)

          Don't you mean "in the CHILD table (Event)?"

          In any case, you would use Set Field to enter the correct ID number from __pkEventTask, not EventTaskType. (This happens to be what the value list does as well. It enters the Field 1 value into the field even though it may display the field 2 value.)

          How you determine which ID number is the correct value, is something I can't tell you from your post.