Jump to content
Server Maintenance This Week. ×

"Reversable"(?) lookup


Fulcher

This topic is 8569 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I'm making a schedule; would like to have a list of dorm rooms and beds (probably in one db) and a list of names in another. Would like to assign a room and bed to a person. Then would like to be able to bring up the room and see what person(s) have been assigned to that room.

Link to comment
Share on other sites

Make a relationship in each file that based on the same two fields to the other file.

For instance, you have a database called "Beds.fp5" with a field that uniquely identifies each bed, "Bed_ID". Your other file, Students.fp5, will also have a Bed_ID field. Set up a relationship in Beds.fp5 to Students.fp5 with Bed_ID=::Bed_ID. Do the same thing in Students.fp5, relating it to Beds.fp5.

Now when you assign a bed to a student (by giving that student the Bed_ID of the bed he or she has), from the Beds.fp5 file you'll be able to see what student is assigned to it.

As I've described this setup, you would be setting up what's called a one-to-one relationship. In other words, a record in Bed.fp5 is related to, at most, one record in Students.fp5, and vice versa. However, such a relationship doesn't take into account the fact that a single bed may be assigned to different students at different times and that a student may change beds.

To handle such a contingency, you would need what's called a many-to-many relationship, which is more complex. It would involve a third file between Beds.fp5 and Students.fp5 to keep track of the links between the two.

Let me know if this is what you are looking for.

Chuck

Link to comment
Share on other sites

This topic is 8569 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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