![]() |
|
|
#1
|
|||
|
|||
|
I'm new to VB in access and wandering if there is VB coding to show time n date in access form. Here is the problem i having, i making a simple inventory tracking system, and when the staff key in their ID at the same time the time n date would appear in the time and date column. This could make sure that the time n date would be accurate when the inventory is taken out.
|
|
#2
|
||||
|
||||
|
The Now() Function returns the current Date and Time.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07 If your issue is resolved...follow this link for directions on how to use the Solved thread tool! Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus" |
|
#3
|
|||
|
|||
|
thank... but how do i implement this function into the vb script page in the access form...??
|
|
#4
|
||||
|
||||
|
Well let me get this straight you have a form which is probably used for recording issue of inventory, and on that form you have a field that you want to record the time at which the inventory is issued. You want the time (current time and date) to be automatically recorded when you fill up the form and save the data. If this is your criteria here is my solution:
You need to create a command button. When you do so the Wizard opens. Go to Record Operations. Select Save Record and create the button. The Code marked red will be created automatically for you. Now I have a form in which I have a field called Date. In this field I will record the current date and time. Right Click the Save Command Button that you have created go to the Click Event and open the Vb Code. Add the Line that is in black in the code. This will do the trick. Remember to select general Date format when you are designing the table. Private Sub Command6_Click() On Error GoTo Err_Command6_Click Me.Date = Now() DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Exit_Command6_Click: Exit Sub Err_Command6_Click: MsgBox Err.Description Resume Exit_Command6_Click End Sub Please mark this thread as solved if it solves your problem. |
|
#5
|
||||
|
||||
|
It is really not a good idea to have a field named Date since it is a reserved word.
http://www.allenbrowne.com/AppIssueBadWord.html
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07 If your issue is resolved...follow this link for directions on how to use the Solved thread tool! Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus" |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Current Date Error | McFly | Database Design | 4 | 02-04-2010 06:08 AM |
| Showing date and time when importing to access | timpepu | Import/Export Data | 0 | 05-07-2009 05:13 AM |
| Access Runtime 2007 Date Time Picker Vista not working | sailinxtc | Programming | 0 | 09-17-2008 10:56 AM |
| Changing a date to the current year | fdnyfish | Access | 1 | 03-01-2008 05:34 AM |
| Access Date/Time....I need a "generic" date. | beastmaster | Access | 2 | 12-29-2005 09:55 AM |