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
Solved

Append - add current date

Posted on 2016-11-03
5
44 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 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 50

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 50

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

839 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