Solved

Append - add current date

Posted on 2016-11-03
5
26 Views
Last Modified: 2016-11-04
Hello,

I am appending records to an archive and want to assign the current date to a [Date_Archive] in the archive table.

Here is the append:
Insert Into Import_FC_Archive
Select Import_FC.*
From Import_FC

I am executing this saved append query like so:
Private Sub cmdImport_Click()
  Docmd.OpenQuery "qryAppend_importFC"

(I have a docmd transferspreadsheet after this) -  typing from phone

Thank you
0
Comment
Question by:pdvsa
  • 2
  • 2
5 Comments
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 250 total points
ID: 41873468
Hi,

pls try
INSERT INTO Import_FC_Archive 
SELECT  *, Date() AS Date_Archive
FROM Import_FC;

Open in new window

Regards
0
 
LVL 49

Assisted Solution

by:Ryan Chong
Ryan Chong earned 250 total points
ID: 41873482
I am appending records to an archive and want to assign the current date to a [Date_Archive] in the archive table.
it's unnecessarily to do it via coding.

go to the field's property. and set its default value to =Now()
SnapShot.png
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 41873485
and set it to =Date() if you want to insert date only.
0
 

Author Closing Comment

by:pdvsa
ID: 41873709
I awarded points to Rgonzo because it is the answer to my question and I was not aware I could set the default value Ryan mentioned.  Even though Ryan's answer is a better one for me and it is the one I will use, I want to be fair as my quesiton only mentioned how to edit the VBA.  I always appreciate a more efficient way to performing a task.  Thank you  

any objections please let me know.
0
 

Author Comment

by:pdvsa
ID: 41873712
Oh I see that the points are split. I did not know that.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now