Accesso: modifica la data con i tasti più e meno
In Microsoft Office Access, è possibile modificare la data utilizzando i tasti più e meno. Ti mostriamo come farlo.
Modifica la data in Accesso con la semplice pressione di un pulsante
Con un semplice elenco è possibile ottenere l'accesso al database per incrementare la data di un giorno ogni volta che si preme il tasto [+] in un campo data di un modulo anziché una data: Il tasto [-] imposta la data di un giorno indietro.
Erwin Schulz
- Per fare ciò, carica il modulo che desideri estendere con questa funzionalità nella vista di progettazione.
- Contrassegnare il campo con la data e dopo un clic con il tasto destro del mouse selezionare la voce "Proprietà".
- Nella scheda "Evento", seleziona la voce in basso "Tasto On", quindi fai clic sul pulsante con i tre punti per aprire "Editor di codice".
- Inserisci la lista sullo screenshot qui. Se il nome del tuo campo non è "Data", devi adattare la macro di conseguenza.
- Tuttavia, poiché la procedura dell'evento funziona solo se viene immesso un valore nel campo della data, è necessario assegnare a questo campo un valore predefinito. Per fare ciò, passa alla scheda "Dati" e, ad esempio, inserisci la stringa "Data ()" nel campo "Valore predefinito" se desideri inserire la data corrente come punto iniziale nel campo della data.
- Quindi passare alla vista modulo. Ora puoi provare la tua nuova funzione di data lì. Apportando piccole modifiche ed estensioni alla lista, puoi anche assicurarti che, ad esempio, il tasto [+] aumenti la data di 10 giorni o il tasto [w] (codice ASCII 119) aumenti la data di una settimana (7 giorni).