Jump to content

Auto enter next days date in a data entry field

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

Recommended Posts

FMPV7 - I am developing a time card layout. The user needs to enter up to 21 days worth of date, time-in, time-out etc. I would like to be able to have the user enter the first date and then on the next line when they click on the date field have the script enter the Next Days Date automatically. I could use some help in developing the script steps or the calculation.



Link to comment
Share on other sites

Hi Bob,

You haven't explained your structure but I believe this should work for you ...

You will want to increment by date per employee independently so you need to create a self-join (another table occurrence of your timecard table) joining StaffID = StaffID. I don't think it needs to be sorted because they will be sorted naturally (unsorted, smile) by WorkDate date. I have omitted weekends in the first calc. But if the staff works the weekend they can change the date and it will begin moving forward from there again.

WorkDate (standard date field with) as Auto-Enter (checked Do Not Replace Existing Value), and in calc box, checked 'Do Not Evaluate if All Referenced Fields are Empty':

Last(self-join::WorkDate) + 1 + Choose( Mod ( Last(self-join::WorkDate) + 2 ; 7 ); 2; 1)

If you want every day included, it would be:

Last(self-join::WorkDate) + 1

A final thought: I usually don't allow staff to generate time records. Instead I would script it; which runs through the current staff records and loop-creates the necessary month records. Why? Because staff will forget or make mistakes. You will have holes and errors and an unhappy Payroll Dept. I create the records for them; they simply indicate hours worked (or vacation or whatever). Much would depend upon whether they were full- or part-time. They are not allowed to delete time records either. But that's just me. grin.gif


Link to comment
Share on other sites

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