Copy entire record via macros (1 Viewer)

pli

New member
Local time
Today, 03:57
Joined
Mar 1, 2012
Messages
5
Hi everyone,

I am curious if I can copy the entire last record in a table with a macro. I'm working with web forms and Sharepoint so I can't use vba or append queries (a total pain). The system limits me to using macros which is pretty inflexible (In addition, its not the full suite of macro options as in the client macros.) I've tried doing a "for" loop, matching the last pkey with the attribute in the field and importing each attribute over in a data macro but it puts the entire site in an invalid state. I'm including the code below (its in XML format):

Code:
<?xml version="1.0" encoding="UTF-16"  standalone="no"?>
<DataMacros xmlns=""><DataMacro  Name="eqAdd">
<Parameters>
    <Parameter Name="maxCC"  Description="Max ID of  [CC]"/>
</Parameters>
<Statements>
<ForEachRecord>
     <Data Alias="aEQ">
          <Reference>equipment</Reference>
          <WhereCondition>[equipment].[id]=[maxCC]-1</WhereCondition>
     </Data>
    <Statements>
         <CreateRecord>
              <Data>
                 <Reference>equipment</Reference>
            </Data>
             <Statements>
                <Action  Name="SetField">
                    <Argument  Name="Field">dt</Argument>
                    <Argument  Name="Value">[aEQ].[dt]</Argument>
                 </Action>
            </Statements>
          </CreateRecord>
      </Statements>
</ForEachRecord>
</Statements>
</DataMacro>
</DataMacros>
I cut a bit of the repetitive sections out, but the structure is the same. Can anyone help or suggest another way to do this?

I'm using: Access 2010 w/SharePoint Server 2010
 

zinrey

New member
Local time
Today, 11:57
Joined
Apr 19, 2012
Messages
5
You may find the answer in a thread I started in the forms sections of this forum useful - I can't post hyperlink to it but it last part of URL is '/showthread.php?t=224867'. My issue was slightly different but using Lookup record in a data macro and some vars may help you. You could then create your record in the same data macro or in a second macro that calls the first.
 

Users who are viewing this thread

Top Bottom