79213972

Date: 2024-11-22 07:20:48
Score: 2.5
Natty:
Report link

sorry about the delay. Did you find the solution?

a) is easy, you just take the last record Add this into your form:

function on_before_post(item) {
    if (item.is_new()) {
        let copy = item.copy();
            copy.open();
            if (copy.rec_count ===0) {
                item.tach_in.value = 1;
            }   else {
                item.tach_in.value = item.tach_out.value;
            }
    }
}

This can be seen on https://msaccess.pythonanywhere.com/ if for example you clone the record it will increase last record by 1.

b) not sure that I follow. Summary is created automatically, like on above app. If Flight duration is needed on the Form (like on the image), than just calculate it with JS. Ie:

function on_edit_form_shown(item) {
    if (item.tach_out.value) {
        item.flight_total.value = item.tach_out.value - item.tach_in.value;
    }
}

If duration is needed on the View grid, than use similar approach as msaccess one for Actual Amount.

Hope this helps.

Reasons:
  • Whitelisted phrase (-1): Hope this helps
  • RegEx Blacklisted phrase (3): Did you find the solution
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Platipus