Okay all,
I'm brand new to Sesame - am having to work on it for a client; but I've been a PHP/mySQL and MS-SQL junkie for the last 2 years... So SBASIC is all new to me, and I'm having to mentally re-adjust to the limited access and methods that Sesame uses to access the DB.
I'm trying to implement something that SHOULD be possible, but I'm not sure what the best method is to implement it... I have a Database of family members, and I want to create what I would term in SQL as a "foreign key" relationship between records. Tips, suggestions, or advice are certainly appreciated!
Basically, I have a numeric field "personID" to uniquely identify each person/record (a "primary key" in SQL terms). I also have the field "fatherID" - the idea being that this field will refer to an existing "personID" record if that person's father is already in the database, so that parent/child relationships can be tracked.
However, I don't want to require the users to remember the actual ID numbers - so I was hoping to display a list-box or combo-box in the form, and have it populate (On Form Entry) with the names of all of the males currently in the database. When a selection is made, the ID number of that person could be stored in the "fatherID" field; and on future viewings, the name of the selected "father" could be automatically retrieved and displayed on the form.
Of course, the first issue is that the combo-box needs to display text information (the potential father names), while the value to be saved is numeric. Maybe I'm spoiled, but in HTML forms you can have combo/list-box items display one thing, but their actual value be something else entirely (i.e. a "key-value" pair). I can't see a way at the moment (except perhaps with a static array or something??) to retrieve the values from 2 columns of a database at once, and keep them associated with each other while the user selects one. They need to stay associated to guarantee that the proper ID number is recorded - (i.e. going back and looking up the father's name to retrieve his personID from the database after selecting him is not acceptable, as the names themselves are not going to be guaranteed to be unique).
Any thoughts, comments, concerns? I see a couple of possible ways of doing it; but I'm hoping your suggestions will point to a clearer or less-cumbersome solution than what I'm envisioning...
Thanks, take care,
--Noel noel_wade@hotmail.com
|