Domanda

I am recording the employee's date_of_birth, the year_employed and the current_DateTime the data is recorded (the actual date and time the user clicks save), since the company is automating its records.
There is no datepicker or monthcalendar control in DataWindow object which would have made it easier for the user to pick the dates.

  1. What is the most efficient way as opposed to the user writing the dates on a column?
  2. What is the code to enter the current_DateTime in the DataWindow to the database?
È stato utile?

Soluzione

1. Datetime selection

There is no datepicker or monthcalendar control in datawindow object which would have made it easier for the user to pick the dates.

Not exactly. You can add a drop-down calendar to help the selection of a date :

  1. select a date / datetime column in your DW
  2. in the properties / edit tab: select a style type "EditMask"
  3. check the "drop-down calendar" setting in the same tab

The field will have a drop-down arrow that will show you a calendar to pick a date.

You can also customize the Mask to suit your display needs.

2. Current time historization

You could define your current_DateTime column to be not null while setting a default value in the table to Now(). Ignore the field completely in PB. Thus when a new record will be added from pb it will get the current time defined by the database.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top