Steve S Posted February 20, 2004 Posted February 20, 2004 Im jsut bad with the logic of scripts... I havd DB a and DB b with a relationship betwen the Last_Name field trying to figure out how to make a button in DB a that goes to related record in DB b. This is easy enought to do. However, if there is NO related record it currently does nothing. I would like it to do something. Like if there is no related record go to the first record. thanks!
Justin Grewe Posted February 20, 2004 Posted February 20, 2004 Hey Steve, Here is your solution. Test.fp5 perform the related records script "New." If there is not a related record in test2.fp5 then it will show the first record. Justin Grewe examplescripts.zip
Jim McKee Posted February 20, 2004 Posted February 20, 2004 Steve ... Here's a variation on Justin's example. I'll repeat something that's been said over and over here: don't use names of any kind as the relational key field. Names change, and your relationships can break as a result. Relationships are best built between values that will never change. That said, in this little demo, the "gRR_name" script first checks if there are any related records. If not, it gives the user options for how to proceed. It's just a simple example of how to handle situations where there are no related records. Main_Related.zip
Recommended Posts
This topic is 7585 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 accountSign in
Already have an account? Sign in here.
Sign In Now