If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Hot key's
I have a database that has several forms used for various
applications involving the entering of a date in one of the forms various fields. I was wondering if it was possible to do the following- A form is opend by the user containing 4 fields. The first two fields are "Date" (start and end)fields and the last two fields are "Time" (start and end) fields. When the first field has the focus, I would like the user to be able to hit "T" on their key board and it enter today's date "Date()". If they hit "Y" they it would enter yesterdays date. This would be the case when the first two fields have the focus. When the second two fields get the focus, hitting "N" on the key board would enter the current time. Is this possible? TIA |
#2
|
|||
|
|||
Hot key's
Check Access VB Help on the KeyDown or KeyPress Event,
IIRC, you should be able to use one of these Events to assign the value to the Control. There are some inbuilt shortcuts you can also use: Ctrl + ; gives today's date Ctrl + Shift + : gives current time. HTH Van T. Dinh MVP (Access) -----Original Message----- I have a database that has several forms used for various applications involving the entering of a date in one of the forms various fields. I was wondering if it was possible to do the following- A form is opend by the user containing 4 fields. The first two fields are "Date" (start and end)fields and the last two fields are "Time" (start and end) fields. When the first field has the focus, I would like the user to be able to hit "T" on their key board and it enter today's date "Date()". If they hit "Y" they it would enter yesterdays date. This would be the case when the first two fields have the focus. When the second two fields get the focus, hitting "N" on the key board would enter the current time. Is this possible? TIA . |
#3
|
|||
|
|||
Hot key's
-----Original Message----- Check Access VB Help on the KeyDown or KeyPress Event, IIRC, you should be able to use one of these Events to assign the value to the Control. There are some inbuilt shortcuts you can also use: Ctrl + ; gives today's date Ctrl + Shift + : gives current time. HTH Van T. Dinh MVP (Access) Thanks for the response. I took a look at the KeyDown/KeyPress event, and I have been able to specify changing the value to Date(), but only with the Tab, Shift, Ctl, Alt keys. I dont see a way to specify the "T" key and not the others. Antonio -----Original Message----- I have a database that has several forms used for various applications involving the entering of a date in one of the forms various fields. I was wondering if it was possible to do the following- A form is opend by the user containing 4 fields. The first two fields are "Date" (start and end)fields and the last two fields are "Time" (start and end) fields. When the first field has the focus, I would like the user to be able to hit "T" on their key board and it enter today's date "Date()". If they hit "Y" they it would enter yesterdays date. This would be the case when the first two fields have the focus. When the second two fields get the focus, hitting "N" on the key board would enter the current time. Is this possible? TIA . . |
#4
|
|||
|
|||
Hot key's
Thanks for the response.
I took a look at the KeyDown/KeyPress event, and I have been able to specify changing the value to Date(), but only with the Tab, Shift, Ctl, Alt keys. I dont see a way to specify the "T" key and not the others. Antonio -----Original Message----- Check Access VB Help on the KeyDown or KeyPress Event, IIRC, you should be able to use one of these Events to assign the value to the Control. There are some inbuilt shortcuts you can also use: Ctrl + ; gives today's date Ctrl + Shift + : gives current time. HTH Van T. Dinh MVP (Access) -----Original Message----- I have a database that has several forms used for various applications involving the entering of a date in one of the forms various fields. I was wondering if it was possible to do the following- A form is opend by the user containing 4 fields. The first two fields are "Date" (start and end)fields and the last two fields are "Time" (start and end) fields. When the first field has the focus, I would like the user to be able to hit "T" on their key board and it enter today's date "Date()". If they hit "Y" they it would enter yesterdays date. This would be the case when the first two fields have the focus. When the second two fields get the focus, hitting "N" on the key board would enter the current time. Is this possible? TIA . . |
#5
|
|||
|
|||
Hot key's
Private Sub Text0_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) = "t" Then KeyAscii = 0 Me.Text0.Value = Date End If End Sub -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (No private e-mails, please) "Antonio" wrote in message ... Thanks for the response. I took a look at the KeyDown/KeyPress event, and I have been able to specify changing the value to Date(), but only with the Tab, Shift, Ctl, Alt keys. I dont see a way to specify the "T" key and not the others. Antonio -----Original Message----- Check Access VB Help on the KeyDown or KeyPress Event, IIRC, you should be able to use one of these Events to assign the value to the Control. There are some inbuilt shortcuts you can also use: Ctrl + ; gives today's date Ctrl + Shift + : gives current time. HTH Van T. Dinh MVP (Access) -----Original Message----- I have a database that has several forms used for various applications involving the entering of a date in one of the forms various fields. I was wondering if it was possible to do the following- A form is opend by the user containing 4 fields. The first two fields are "Date" (start and end)fields and the last two fields are "Time" (start and end) fields. When the first field has the focus, I would like the user to be able to hit "T" on their key board and it enter today's date "Date()". If they hit "Y" they it would enter yesterdays date. This would be the case when the first two fields have the focus. When the second two fields get the focus, hitting "N" on the key board would enter the current time. Is this possible? TIA . . |
#6
|
|||
|
|||
Hot key's
Van, Doug, Thank you both very much for your help.
-----Original Message----- Private Sub Text0_KeyPress(KeyAscii As Integer) If Chr(KeyAscii) = "t" Then KeyAscii = 0 Me.Text0.Value = Date End If End Sub -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (No private e-mails, please) "Antonio" wrote in message ... Thanks for the response. I took a look at the KeyDown/KeyPress event, and I have been able to specify changing the value to Date(), but only with the Tab, Shift, Ctl, Alt keys. I dont see a way to specify the "T" key and not the others. Antonio -----Original Message----- Check Access VB Help on the KeyDown or KeyPress Event, IIRC, you should be able to use one of these Events to assign the value to the Control. There are some inbuilt shortcuts you can also use: Ctrl + ; gives today's date Ctrl + Shift + : gives current time. HTH Van T. Dinh MVP (Access) -----Original Message----- I have a database that has several forms used for various applications involving the entering of a date in one of the forms various fields. I was wondering if it was possible to do the following- A form is opend by the user containing 4 fields. The first two fields are "Date" (start and end)fields and the last two fields are "Time" (start and end) fields. When the first field has the focus, I would like the user to be able to hit "T" on their key board and it enter today's date "Date()". If they hit "Y" they it would enter yesterdays date. This would be the case when the first two fields have the focus. When the second two fields get the focus, hitting "N" on the key board would enter the current time. Is this possible? TIA . . . |
Thread Tools | |
Display Modes | |
|
|