Forum Discussion

DanielEastman's avatar
DanielEastman
Qrew Trainee
7 years ago

How do I default a value to the value entered in the last record?

First time making an app, so apologies if this is obvious...

I am attempting to build an app that tracks Items.  Each Item has a Location.  When entering the data, the Items from one Location are entered, then the Items from the next Location, then the next, etc....  The Location on the data entry form is related to another table.  Data entry would be easiest if the Location defaulted to last value entered.  Is there an easy way to do this?  Do I need to embed another form (like a heading)?

Any insight would be appreciated by a newby.

Thanks

5 Replies

  • Yes.  There are two tables.  One table is Locations, and one table is Items.  The Items table has a relationship to the Locations table.  Many Items for each Location.
  • Here is what I am trying to do...

    It is just a simple application to track food that is in multiple kitchens so that leftover items can be used before spoilage.  For example, one of the chefs planned on using 18 lbs of asparagus in his soup.  His projections changed, so he ended up using only 10 lbs.  He has 8 lbs, and does not have asparagus soup on his menu for the week.  However in another of our kitchens, a different chef has grilled asparagus planned on a menu.  The product could be used over there, and not go to waste.  Multiply this by multiple ingredients in multiple locations.  Each chef inventories their own kitchen, and currently, they are just emailing one another.  Instead, I am hoping to make a handy-dandy little application that shows the location, amount and type of food that a chef is hoping to get used elsewhere.  Each chef enters the items into a form, and right now, they have to enter the kitchen (it is just a dropdown, so not a big deal) over and over again.  A simpler/better solution would be to add it once per time they sit down to enter the information.  The way I currently have it set up, I was hoping for an easy way to just default the Location (kitchen) to the value that was last entered into the table.
  • No problem.
    We will need to make a reverse relationship.
    Edit the relationship to create a new Summary field of the Maximum Record ID#.  Call the field [Record ID# of last location].

    Then make a new relationship where 1 Location has Many items.

    On the right hand side use the field you just created as opposed to the field [Related Location] which it will suggest.  Do not bring in any lookup fields.

    Then edit the relationship to bring down the location.  Call it [Most Recent Location]

    Now you have the location of the most recent Location on the item record.  Look that up down to the Locations table.

    Now make a form rule on he Locations form that says

    When the location is blank
    Change the value in the field location to the value in the field 
    [Most Recent Location]