Solved

Append - add current date

Posted on 2016-11-03
5
50 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 50

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 51

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 51

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
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…

749 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