Tom Kennedy Posted May 8, 2008 Posted May 8, 2008 I have a State layout form which displays State records. I would like to create a 2nd form layout that displays records for Cities. The Cities need to display for the current State record that is displayed on the State layout form. Any help will be appreciated.
dreamingmind Posted May 8, 2008 Posted May 8, 2008 (edited) - Build a relationship so each state record can see all its related city records --- more info on this process if you need it: ----- state table has state field ----- city table has state field ----- relate the state fields to each other - make your state layout - make your city layout - create a simple script that does go-to-related-record from the state to it's city collection, and which also displays the found set of related records in the city layout. - tie your script to a button on the state layout. Yer all set! Regards, Don Drake Edited May 8, 2008 by Guest
Tom Kennedy Posted May 11, 2008 Author Posted May 11, 2008 Thanks for the advice, however: This works when there are related records, but does not work if related records do not exist. Is there a way to load the foreign key in a new related record and commit the related record before the "Get Related Records" code executes?
dreamingmind Posted May 11, 2008 Posted May 11, 2008 Tom, That's one way to go. Personally, I'd probably just add a little error check to the script to make sure the relationship is turning up some related records. In the case of the error condition just toss up a dialog. Then you don't have to deal with any extra records you might create in your method. I'm a little bit rusty on the specifics right now... maybe the IsValid calculation will work in this case or perhaps you can do GetField on the related data and see if you actually got anything. Regards, Don Drake
Recommended Posts
This topic is 6377 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