Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy a date from one column to another with a macro

Status
Not open for further replies.

Saxie1

Technical User
Jan 20, 2000
15
US
I am working with an Access97 database that I did not write, but need to edit large amounts of data in. The two columns of interest are adjacent to each other. The first column contains a valid date but the second does not.

Column 1 Column 2
6/16/2003 12:16:12 AM 12:00:00 AM
6/15/2003 10:44:06 PM 12:00:00 AM

I want to create a macro that will copy the data from Column 1 into Column 2 and add 2 minutes to it for each record.

Here is a portion of what I have tried so far:
runcommand - copy
sendkeys - {TAB}
runcommand - paste

The copy command works (I can manually press {^V} and the data pastes), but the paste command doesn't do anything. I have tried to use the sendkeys {^V} command but I get the infamous "Need to Load" sendkeys error.

Any suggestions??
 
Why use a macro to do this? It's much easier to do as an update query. Use the Dateadd function with "n" as the interval, 2 as the number and [Column 1] as the date
Simon Rouse
 
Simon you are an AWESOME individual!! I tend to do things the hard way, so this was a big change of pace for me.

Thank you for the help!!!

 
It often takes a lot of experience to do things simply. We forget that there are times when pen and paper is the best solution to a problem!
Simon Rouse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top