Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i enter todays date by using a function key

Status
Not open for further replies.

Phideaux

Technical User
May 1, 2003
51
US
I need to enter todays date in various MS Access forms by using a function key.( say "F12" or "Cntl F Something" ) is there any way to use a VB code that will make it possible to enter todays date in any place needed while running the application or in lines of text or fields?

thanks in advance for the help

Phideaux


The mind is the best toy.
Play with someone else's often
 
You can use coed to catch key strikes but I would suggest that you set the default value for the fields in question to Date(). The more user interaction you remove, the less problems your likeley to run into.
 
The date may be required in a line of text or several places on a form. the default option for todays date won't do it for me because some of the fields must stay blank untill the Work Order is completed. I also need to use the key in varoius other places but not necessarily each time a form is used. since I'm just starting going beyond Access basic operations I'm not yet aquainted with the "coed" referenced. is here a way to include the function I've outlined so that it is available at any time after i start the application and that Function key operation closes when the application closes?

thanks for the help

The mind is the best toy.
Play with someone else's often
 
Try this
Private Sub Command227_Click()
Me!Text182 = Environ("username")
Me!Text184 = Date
End Sub

make your button but insert this code into the on click event
change the text184 to be what ever text box or memo box(s) you want filled.
If you have fields that you want to fill the username with and are running nt xp or 2k you can use the Environ("username")
just change text182 to what ever text or memo box(s) you need to have filled.
supposedly you can use this for win98 as well but i don't know how and i really haven't gotten a good answer to that either
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top