How to copy a record from table A to table B?

lundi 16 mars 2015

Hi All,

Just a quick question.

I have a form to edit records on table A and i would like to be able to put a button on the form to copy that record from table A to table B but i am a bit stumped. Any help would be great. The code i have on the button so far is as follows:



<UserInterfaceMacro For="Command55" Event="OnClick">

<Statements>

<Action Name="OnError"/>

<Action Name="RunMenuCommand">

<Argument Name="Command">SelectRecord</Argument></Action>



<ConditionalBlock><If><Condition>[MacroError]=0</Condition><Statements>



<Action Name="RunMenuCommand">

<Argument Name="Command">Copy</Argument></Action></Statements></If></ConditionalBlock>



<Action Name="OpenTable"><Argument Name="TableName">Find</Argument></Action>



<ConditionalBlock><If><Condition>[MacroError]=0</Condition>



<Statements><Action Name="RunMenuCommand">

<Argument Name="Command">RecordsGoToNew</Argument></Action></Statements></If></ConditionalBlock>



<ConditionalBlock><If><Condition>[MacroError]=0</Condition>



<Statements><Action Name="RunMenuCommand"><Argument Name="Command">SelectRecord</Argument></Action></Statements></If></ConditionalBlock>



<ConditionalBlock><If><Condition>[MacroError]=0</Condition><Statements><Action Name="RunMenuCommand"><Argument Name="Command">Paste</Argument></Action></Statements></If></ConditionalBlock>



<ConditionalBlock><If><Condition>[MacroError]&lt;&gt;0</Condition><Statements><Action Name="MessageBox"><Argument Name="Message">=[MacroError].[Description]</Argument></Action></Statements></If></ConditionalBlock>



<Action Collapsed="true" Name="CloseWindow"><Argument Name="ObjectType">Form</Argument>

<Argument Name="ObjectName">EditGarments</Argument></Action></Statements></UserInterfaceMacro></UserInterfaceMacros>



Why?

I want someone to be able to search a product for an order, edit it to reflect how many they are taking but at the same time have a button to copy that record to table B. Then after all the products have been found and copied to table B, they can print of the report based on table B and give to the factory floor so they can find the stock, run a query to clear table B and start on the next order.



I have everything working but copying the records across.



I hope this make sense.

How to copy a record from table A to table B?

0 commentaires:

Enregistrer un commentaire

Labels