Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2313
  • Last Modified:

access web app macro to copy data between tables

I need a macro to be able to copy data from one field to another. I tried the attached screen shot but it tosses and error that it cannot connect to the server.

Any suggestions appreciated.
MyMacro.JPG
0
911bob
Asked:
911bob
  • 7
  • 3
  • 2
2 Solutions
 
Jeffrey CoachmanMIS LiasonCommented:
will a simple msgbox macro work?
Just trying to see if this is a connection issue...

If you just keep the micro simple and copy from one field do another (for one record, ...without looping) does it work.

Is "NewRecord" he name of a form?

If this is really a new record you are creating, ...then perhaps the values are not saved to the underlying table yet?


Finally, ..what is the need for doing this, ...perhaps the is a better way...
0
 
911bobCTOAuthor Commented:
In an Office365 Access web app, there is no append capability. To add data to a table I want to import it as a new table then "copy the data" over to the new table.
[NewRecord] is the alias for the table Cases3
0
 
Jeffrey CoachmanMIS LiasonCommented:
Hard to believe that there is no easier way to do this in a web app.

You cannot select the table and copy it, ...then paste it back in?
You cannot create a blank table in SQL, then append data to it? (Run basic SQL commands)...?

Then I am curios as well,... so lets see what other experts say...
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
911bobCTOAuthor Commented:
Found this, but do not see how to what they say.
http://office.microsoft.com/en-us/access-help/import-data-into-an-access-database-HA102840199.aspx

And the copy paste does not seem to work for web app
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
That article talks about importing data from other sources. You said you want to COPY a table, which indicates both tables are available in the web app. Is that not the case? Is one of the tables in an external database?
0
 
911bobCTOAuthor Commented:
I am trying to append external data to an existing table..

So I have imported that data into a new table in the web app and now want to copy the records into the existing table. Per the above:

Importing data into an app always creates a new table with default List and Datasheet views.

You can’t append data to existing tables using the Import Wizard in an app. However, you can import data into a new table and then do one of the following:

Use datasheet views to copy and paste the data into the target table, or

Use the CreateRecord action in a data macro to add the imported data to the target table.

I cannot copy and paste the rows in the datasheet view so I want to attempt the Create record action to copy row by row in a macro. That is the macro I have show in the listing
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
From what I can see,  your macro looks correct. You're calling CreateRecord, and then setting each value.

Only suggestion would be to NOT use an Alias and see if that matters (I doubt it would, but it worth a shot).
0
 
911bobCTOAuthor Commented:
It seems to run but I get a Action Failed message.. see attached.ActionFailed.JPG
0
 
911bobCTOAuthor Commented:
Found the issues:

1) I had forced the dataMacro to run directly. Even though it was not listed in the runMacro I typed it in and tried to force it. I fixed it by creating a "Macro" and then calling the DataMacro from that macro.

2) I had originally put the view with the macro on the first view.. but the source table was not in the view. I moved the calling macro view to the table that was to be imported.

After those 2 steps.. it works..

Thanks for the suggestions.. Getting your head wrapped around the Access Web apps take a little bit different thinking than the desktop node
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Glad you found the issue. Please be sure to accept your last comment as the solution when closing it out. I'm sure this could save someone a bit of frustration down the road!
0
 
911bobCTOAuthor Commented:
Thanks for input from everyone,,
Gave Scott some points for pointing me in the right direction..
0
 
911bobCTOAuthor Commented:
I found the solution myself
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 7
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now