Updating date field
To achieve the two dates given above, you would need: You'll actually have to do a little surgery to achieve this one.
You'll need to select both the "dddd, MMMM d, yyyy" and the "h:mm:ss am/pm" options and add both to the field.
Function Update Transaction Date() As Boolean Dim db As Database Dim LUpdate As String Dim LMsg As String Dim LTransaction Dt As Date On Error Go To Err_Execute 'Query user for Date of R LMsg = "Enter the Date of R Form __/__/____" LMsg = LMsg & Chr(10) & Chr(10) & "Format date as: mm/dd/yyyy" LTransaction Dt = Input Box(LMsg) Set db = Current Db() 'Re-Assign Date to Transaction Date LUpdate = "update [Chapter Form Bulk Input Table]" LUpdate = LUpdate & " set [Transaction Date] = #" & Format(LTransaction Dt, "mm/dd/yyyy") & "#" db.
Execute LUpdate, db Fail On Error Set db = Nothing Msg Box "Changing the Dates was Successful." Update Transaction Date = True On Error Go To 0 Exit Function Err_Execute: Msg Box "Updating the dates failed, you will need to enter each date individually." Update Transaction Date = False End Function You can then call the function from a Form (ie: button click event, etc) or a Macro and it will update the Transaction Date field.
In Microsoft Access 2003/XP/2000/97, I have a database which contains a date field called Transaction Date.
I want to be able to query the user for a new date and then update the Transaction Date field based on what the user entered.
Another useful field is the field, which records when the document was last saved.Perhaps the most useful date field is the field, which permanently records the date a document was created.At first glance this might not seem very different from plain text, but if you put this field in a template, each document based on it will automatically have the date it was created.The method that most users discover first is the Date and Time command on the Insert menu, which opens the Date and Time dialog.
(In Word 2007/2010/2013, access this dialog using Insert | Text | Date and Time.) Figure 1.Use the After Update event to perform any actions that you want to occur when a record is changed.