Jump to content
Server Maintenance This Week. ×

Value from Previous


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

Recommended Posts

  • Newbies

Hi

I'm not sure if I've got a logical problem here or what, but I'd appreciate any advice.

I have two related db files. The first is kind of a master interface that collects and displays information from the second, related file (it also has its own dataset, but I don't think that's relevant to the problem I'm having).

What I'm trying to do is allow users to key in a chapter number in the master file, which will be written into the secondary file. Once that number is keyed, a second field in the related db should be automatically filled in by picking up the value from the previous record.

What's actually happening, though, is the autoentry field is picking up the data from the FIRST record in the related db, rather than the PREVIOUS record.

I guess my question, then, is this: does the autoentry function work when it's happening "behind the scenes" in a related file? If it does, does anyone have any idea what I might be doing wrong here?

Thanks.

Link to comment
Share on other sites

  • 4 weeks later...

When working in portals, Filemaker seems to use the top record in the portal as "previous." A really ugly workaround is to have date and time fields in your related file set to autoenter the creation date and time. Then, in your define relationships setup, select sort order for the relationship to be:

date (decending)

time (decending)

This will move the most recently created record to the top of the portal, and hence allow that value to be used as "previous" the next time you create a new entry. Unfortunately, the big problem is that the portal won't re-sort unless you click outside of it. So, if you keep adding new records without clicking outside, the autoenter still won't work properly. The other disadvantage is that you probably don't want the items listed in reverse chronological order in the portal.

Another method (with other disadvantages) is as follows:

In your related file define a numeric field called SerialNo with the options set to autoenter Serial Number

Then create a self-join relationship called "Chronological" using the SerialNo field.

Now, for the field that you want to have filled with the data from the previous record, instead of using autoenter previous record, use autoenter Looked-up value using the Chronological relationship. Select the "copy next lower" radio button. That way, you will always use the most recently entered value.

The disadvantage with this method is that it will ignore the relationship between the master file and the related file and just pull up the most recently entered data, not the most recent pertaining to the related records. This may be acceptable if you just want to speed up entry of records by re-posting the most recent data as the default.

[This message has been edited by BobWeaver (edited November 30, 2000).]

[This message has been edited by BobWeaver (edited December 12, 2000).]

Link to comment
Share on other sites

Further update. I've played around with this a bit and found a way to do exactly what you want, but it's nasty. It involves creating a couple of self-join relationships, a calculated field, a looked-up field, and two calculated autoenter fields. If you are really desperate, I can post it (if I can figure out how to explain it.)

Link to comment
Share on other sites

This topic is 8560 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.