Topic: Rolling Fields - How to achieve?

Greeting,

As I push thru my first MVD project I am again trying to figure out how to implement something or whether there might be better ways. Using MVD v6.5 with SQLite DB.

I have the following situation.  I have two (2) sets of 5 fields that are a status and date for that status.  The fields are  Current, Prev-1, Prev-2, Prev-3 & Prev-4.  When a new event occurs I want to put it into the Current fields, but first must roll Prev-3 into Prev-4, Prev-2 into Prev-3 ... and finally the Current into Prev-1 before installing the new Current Values.

These fields are on a form in a single row presently.  How can I effect the rolling of the values?

Regards,
Keith

2 (edited by derek 2021-02-14 18:38:15)

Re: Rolling Fields - How to achieve?

Hi Keith,
Not sure from your description whether you're updating directly on the tablegrid or on the 'edit' form.
Attached are a couple of examples of different approaches you could take (first approach is updating the table directly with an 'sqlupdate', the second approach is shuffling values from one edit field / datetimepicker to another on the 'edit' form),  Pros and cons to each depending on how you're wanting to work your project.
Derek.

Post's attachments

Attachment icon keith rolling.zip 879.5 kb, 214 downloads since 2021-02-14 

Re: Rolling Fields - How to achieve?

Derek,

Sorry I wasn't more clear & specific.  Initially I had all of the fields in simple Edit-Boxes on a form. I am not sure that it would make much of any difference whether they were separate edit fields or a tablegrids other than I started with Edit fields not giving any more thought at that moment.

My main concern was where I could access those fields, shift the data, before the actual record update occurred.

Keith

Re: Rolling Fields - How to achieve?

Derek,

Option #2 was more like what I had envisioned... however the SQL version is a nice education for me THANX !!

Keith