<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Accounting systems &#187; Syspro</title>
	<atom:link href="http://accountingsystems.ie/?feed=rss2&#038;cat=3" rel="self" type="application/rss+xml" />
	<link>http://accountingsystems.ie</link>
	<description>Our free tips and tricks blog for Intact accounts, Sage, Syspro, Quickbook and bits of SAP and Oracle</description>
	<lastBuildDate>Tue, 06 Jul 2010 19:48:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Exporting Signed Numerics EBCDIC</title>
		<link>http://accountingsystems.ie/?p=24</link>
		<comments>http://accountingsystems.ie/?p=24#comments</comments>
		<pubDate>Sun, 06 Jun 2010 19:41:51 +0000</pubDate>
		<dc:creator>Patrick Jones</dc:creator>
				<category><![CDATA[Syspro]]></category>
		<category><![CDATA[Impact Award]]></category>
		<category><![CDATA[Legacy Systems]]></category>

		<guid isPermaLink="false">http://accountingsystems.ie/?p=24</guid>
		<description><![CDATA[I needed a function to create an EBCDIC overpunch to numeric values in an access database when exporting the data as text files for loading into OneSource.
This function might help if you need something similar

Function EbcDic(ByVal tmpNumber As Double, ByVal tmpDec As Integer, ByVal tmpPlaces As Integer)
'--------------------------------------------------------------------------------------
'OneSource Requirement for Signed Numeric Fields
'Below is the conversion [...]]]></description>
			<content:encoded><![CDATA[<p>I needed a function to create an EBCDIC overpunch to numeric values in an access database when exporting the data as text files for loading into OneSource.</p>
<p>This function might help if you need something similar</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Function</span> EbcDic(<span style="color: #000080;">ByVal</span> tmpNumber <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, <span style="color: #000080;">ByVal</span> tmpDec <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, <span style="color: #000080;">ByVal</span> tmpPlaces <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>)
<span style="color: #008000;">'--------------------------------------------------------------------------------------
</span><span style="color: #008000;">'OneSource Requirement for Signed Numeric Fields
</span><span style="color: #008000;">'Below is the conversion table of signed numeric values (right most over-punch character) to EBCIDIC:
</span><span style="color: #008000;">'(you do not need to worry about positive numbers, it is only negative numbers that need the translation)
</span>
<span style="color: #008000;">'Positive   'Negative
</span><span style="color: #008000;">'0 = {      '0 = }
</span><span style="color: #008000;">'1 = A      '1 = J
</span><span style="color: #008000;">'2 = B      '2 = K
</span><span style="color: #008000;">'3 = C      '3 = L
</span><span style="color: #008000;">'4 = D      '4 = M
</span><span style="color: #008000;">'5 = E      '5 = N
</span><span style="color: #008000;">'6 = F      '6 = O
</span><span style="color: #008000;">'7 = G      '7 = P
</span><span style="color: #008000;">'8 = H      '8 = Q
</span><span style="color: #008000;">'9 = I      '9 = R
</span><span style="color: #008000;">'
</span><span style="color: #008000;">'  (for example a -592.52 ... will be passed as 00000005925K)
</span><span style="color: #008000;">'--------------------------------------------------------------------------------------
</span>
<span style="color: #000080;">Dim</span> tmpStr, tmpTrans, tmpPos, tmpFactor
<span style="color: #000080;">Dim</span> tmpFilled
tmpFilled = <span style="color: #800000;">&quot;00000000000000&quot;</span>
&nbsp;
<span style="color: #000080;">If</span> Len(tmpNumber &amp; <span style="color: #800000;">&quot;&quot;</span>) = 0 <span style="color: #000080;">Then</span>
    EbcDic = right(tmpFilled, tmpPlaces)
    <span style="color: #000080;">Exit</span> <span style="color: #000080;">Function</span>
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
<span style="color: #000080;">Select</span> <span style="color: #000080;">Case</span> tmpDec
<span style="color: #000080;">Case</span> 0
    tmpFactor = 1
<span style="color: #000080;">Case</span> 1
    tmpFactor = 10
<span style="color: #000080;">Case</span> 2
    tmpFactor = 100
<span style="color: #000080;">Case</span> 3
    tmpFactor = 1000
<span style="color: #000080;">Case</span> 4
    tmpFactor = 10000
<span style="color: #000080;">End</span> <span style="color: #000080;">Select</span>
&nbsp;
<span style="color: #000080;">If</span> tmpNumber &gt;= 0 <span style="color: #000080;">Then</span>
    EbcDic = right(tmpFilled &amp; Int(tmpNumber * tmpFactor), tmpPlaces)
    <span style="color: #000080;">Exit</span> <span style="color: #000080;">Function</span>
<span style="color: #000080;">Else</span>
    tmpTrans = Int((tmpNumber * tmpFactor) * -1)
    tmpPos = InStr(1, <span style="color: #800000;">&quot;0123456789&quot;</span>, right(tmpTrans, 1), 1)
&nbsp;
    tmpStr = Left(tmpTrans, (Len(tmpTrans) - 1)) &amp; right(Left(<span style="color: #800000;">&quot;}JKLMNOPQR&quot;</span>, tmpPos), 1)
   EbcDic = right(tmpFilled &amp; tmpStr, tmpPlaces)
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://accountingsystems.ie/?feed=rss2&amp;p=24</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading foreign characters into Syspro</title>
		<link>http://accountingsystems.ie/?p=16</link>
		<comments>http://accountingsystems.ie/?p=16#comments</comments>
		<pubDate>Thu, 06 May 2010 18:38:49 +0000</pubDate>
		<dc:creator>Patrick Jones</dc:creator>
				<category><![CDATA[Syspro]]></category>

		<guid isPermaLink="false">http://accountingsystems.ie/?p=16</guid>
		<description><![CDATA[I had an issue loading address fields with swedish and german characters into syspro via an XML upload so used this function to strip out the characters

Function SpecialReplace(ByVal tmpReg) As String
If Len(tmpReg) &#62; 0 Then
    Dim tmpStr
    'start the replace
    'clear double spaces
    [...]]]></description>
			<content:encoded><![CDATA[<p>I had an issue loading address fields with swedish and german characters into syspro via an XML upload so used this function to strip out the characters</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Function</span> SpecialReplace(<span style="color: #000080;">ByVal</span> tmpReg) <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>
<span style="color: #000080;">If</span> Len(tmpReg) &gt; 0 <span style="color: #000080;">Then</span>
    <span style="color: #000080;">Dim</span> tmpStr
    <span style="color: #008000;">'start the replace
</span>    <span style="color: #008000;">'clear double spaces
</span>    tmpStr = Trim(tmpReg)
    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;ä&quot;</span>, <span style="color: #800000;">&quot;a&quot;</span>) <span style="color: #008000;">' ) bracket
</span>    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;Ä&quot;</span>, <span style="color: #800000;">&quot;A&quot;</span>) <span style="color: #008000;">' ) bracket
</span>    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;é&quot;</span>, <span style="color: #800000;">&quot;e&quot;</span>) <span style="color: #008000;">' ) bracket
</span>    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;ö&quot;</span>, <span style="color: #800000;">&quot;o&quot;</span>) <span style="color: #008000;">' ) bracket
</span>    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;Ö&quot;</span>, <span style="color: #800000;">&quot;O&quot;</span>) <span style="color: #008000;">' ) bracket
</span>    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;ü&quot;</span>, <span style="color: #800000;">&quot;u&quot;</span>) <span style="color: #008000;">' ) bracket
</span>    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;Ü&quot;</span>, <span style="color: #800000;">&quot;U&quot;</span>) <span style="color: #008000;">' ) bracket
</span>    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;ß&quot;</span>, <span style="color: #800000;">&quot;s&quot;</span>) <span style="color: #008000;">' ) bracket
</span>    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;Å&quot;</span>, <span style="color: #800000;">&quot;A&quot;</span>)
    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;å&quot;</span>, <span style="color: #800000;">&quot;a&quot;</span>)
    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;Æ&quot;</span>, <span style="color: #800000;">&quot;A&quot;</span>)
    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;æ&quot;</span>, <span style="color: #800000;">&quot;a&quot;</span>)
    tmpStr = FindAndReplace(tmpStr, <span style="color: #800000;">&quot;Ø&quot;</span>, <span style="color: #800000;">&quot;O&quot;</span>)
    SpecialReplace = tmpStr
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

<p>You will need the function below from Alden Streeter</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #008000;">''************ Code Start **********
</span><span style="color: #008000;">'This code was originally written by Alden Streeter.
</span><span style="color: #008000;">'It is not to be altered or distributed,
</span><span style="color: #008000;">'except as part of an application.
</span><span style="color: #008000;">'You are free to use it in any application,
</span><span style="color: #008000;">'provided the copyright notice is left unchanged.
</span><span style="color: #008000;">'
</span><span style="color: #008000;">'Code Courtesy of
</span><span style="color: #008000;">'Alden Streeter
</span><span style="color: #008000;">'
</span><span style="color: #000080;">Function</span> FindAndReplace(<span style="color: #000080;">ByVal</span> strInString <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>, strFindString <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>, strReplaceString <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>) <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>
<span style="color: #000080;">Dim</span> intPtr <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>
    <span style="color: #000080;">If</span> Len(strFindString) &amp;gt; 0 <span style="color: #000080;">Then</span>  <span style="color: #008000;">'catch if try to find empty string
</span>        <span style="color: #000080;">Do</span>
            intPtr = InStr(strInString, strFindString)
            <span style="color: #000080;">If</span> intPtr &amp;gt; 0 <span style="color: #000080;">Then</span>
                FindAndReplace = FindAndReplace &amp;amp; Left(strInString, intPtr - 1) &amp;amp; strReplaceString
                    strInString = Mid(strInString, intPtr + Len(strFindString))
            <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
        <span style="color: #000080;">Loop</span> <span style="color: #000080;">While</span> intPtr &amp;gt; 0
    <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
    FindAndReplace = FindAndReplace &amp;amp; strInString
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://accountingsystems.ie/?feed=rss2&amp;p=16</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Posting Sales Orders in Syspro using XML and Business Objects</title>
		<link>http://accountingsystems.ie/?p=8</link>
		<comments>http://accountingsystems.ie/?p=8#comments</comments>
		<pubDate>Sat, 10 Apr 2010 18:32:22 +0000</pubDate>
		<dc:creator>Patrick Jones</dc:creator>
				<category><![CDATA[Syspro]]></category>

		<guid isPermaLink="false">http://accountingsystems.ie/?p=8</guid>
		<description><![CDATA[The task criteria was to load orders from field sales office by adding automation to Excel files or loading XML files into an access database. This allows the client to validate the order entries and ensure all key data is present before attempting to load the orders into Syspro.
This post covers the export of the [...]]]></description>
			<content:encoded><![CDATA[<p>The task criteria was to load orders from field sales office by adding automation to Excel files or loading XML files into an access database. This allows the client to validate the order entries and ensure all key data is present before attempting to load the orders into Syspro.</p>
<p>This post covers the export of the data from the validated database into Syspro.</p>
<p>To use this code you would need to download and install the free ChilkatXML program see <a href="http://www.chilkatsoft.com" target="_blank">chilkatsoft.com</a> and add a reference to Chilkat XML, DAO 3.6 and Syspro e.Net.</p>
<p>If you any questions on how to use this code please post a question</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Function</span> ExportXML()
<span style="color: #008000;">' this function will use a validated export table of data to create the xml file
</span><span style="color: #008000;">'and pass this file to be executed by Syspro
</span><span style="color: #008000;">'Structure creted on 3-Apr
</span><span style="color: #000080;">Dim</span> xml <span style="color: #000080;">As</span> <span style="color: #000080;">New</span> ChilkatXml
<span style="color: #000080;">Dim</span> HeaderNode <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> OrderNode <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> OrderHeaderNode <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> OrderDetailsNode <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> OrderDetailsStockLineNode <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> OrderDetailsCommentLineNode <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> OrderDetailsMiscChargeLineNode <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> OrderDetailsFreightLineNode <span style="color: #000080;">As</span> ChilkatXml
&nbsp;
<span style="color: #000080;">Dim</span> tmpOrderNumber, tmpEntityNumber, tmpOrderLine
<span style="color: #000080;">Dim</span> rst <span style="color: #000080;">As</span> Recordset
&nbsp;
<span style="color: #000080;">Set</span> HeaderNode = xml.NewChild(<span style="color: #800000;">&quot;TransmissionHeader&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>)
<span style="color: #000080;">Set</span> OrderNode = xml.NewChild(<span style="color: #800000;">&quot;Orders&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>)
&nbsp;
xml.Tag = <span style="color: #800000;">&quot;SalesOrders&quot;</span>
<span style="color: #008000;">'set the header values
</span>HeaderNode.NewChild2 <span style="color: #800000;">&quot;TransmissionReference&quot;</span>, <span style="color: #800000;">&quot;000003&quot;</span>     <span style="color: #008000;">'rst!ID 'use the id of the passed recordset
</span>HeaderNode.NewChild2 <span style="color: #800000;">&quot;SenderCode&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
HeaderNode.NewChild2 <span style="color: #800000;">&quot;ReceiverCode&quot;</span>, <span style="color: #800000;">&quot;HO&quot;</span>
HeaderNode.NewChild2 <span style="color: #800000;">&quot;DatePRepared&quot;</span>, Format(<span style="color: #000080;">Date</span>, <span style="color: #800000;">&quot;yyyy-mm-dd&quot;</span>)
HeaderNode.NewChild2 <span style="color: #800000;">&quot;TimePrepared&quot;</span>, Format(Now(), <span style="color: #800000;">&quot;hh:nn&quot;</span>)
&nbsp;
<span style="color: #000080;">Set</span> rst = CurrentDb.OpenRecordset(<span style="color: #800000;">&quot;qryImportData_Filtered&quot;</span>) <span style="color: #008000;">' this is a filtered list of the record to upload
</span><span style="color: #000080;">If</span> rst.RecordCount = 0 <span style="color: #000080;">Then</span>
    MsgBox <span style="color: #800000;">&quot;Nothing to Process&quot;</span>
    <span style="color: #000080;">GoTo</span> Exit_Func
    <span style="color: #000080;">Exit</span> <span style="color: #000080;">Function</span>
<span style="color: #000080;">Else</span>
    rst.MoveFirst
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
tmpEntityNumber = <span style="color: #800000;">&quot;&quot;</span>
tmpOrderNumber = <span style="color: #800000;">&quot;&quot;</span>
tmpOrderLine = 1
&nbsp;
<span style="color: #008000;">'Set OrderHeaderNode = OrderNode.NewChild(&quot;OrderHeader&quot;, &quot;&quot;)
</span>
<span style="color: #000080;">Do</span> <span style="color: #000080;">While</span> <span style="color: #000080;">Not</span> rst.EOF
&nbsp;
<span style="color: #000080;">If</span> tmpEntityNumber &lt;&gt; rst!O_Entity <span style="color: #000080;">Or</span> tmpOrderNumber &lt;&gt; rst!O_Number <span style="color: #000080;">Then</span>
    <span style="color: #008000;">'Must be a new order - write the header data and fill the static details
</span>    <span style="color: #000080;">Set</span> OrderHeaderNode = OrderNode.NewChild(<span style="color: #800000;">&quot;OrderHeader&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>)
    <span style="color: #000080;">Set</span> OrderDetailsNode = OrderNode.NewChild(<span style="color: #800000;">&quot;OrderDetails&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>)
&nbsp;
    tmpEntityNumber = rst!O_Entity
    tmpOrderNumber = rst!O_Number
    tmpOrderLine = 1
&nbsp;
    <span style="color: #008000;">'Add the order header values
</span>    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;CustomerPoNumber&quot;</span>, rst!O_Number     <span style="color: #008000;">'get from recordset
</span>    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;OrderActionType&quot;</span>, tmpOrderActionType     <span style="color: #008000;">'get from variables
</span>    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;NewCustomerPoNumber&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;Supplier&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;Customer&quot;</span>, rst!O_Entity
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;OrderDate&quot;</span>, Format(<span style="color: #000080;">Date</span>, <span style="color: #800000;">&quot;yyyy-mm-dd&quot;</span>)
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;InvoiceTerms&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;Currency&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;ShippingInstrs&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;CustomerName&quot;</span>, Left(rst!O_ShipName &amp; <span style="color: #800000;">&quot;&quot;</span>, 30)
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;ShipAddress1&quot;</span>, Left(rst!O_Ship1 &amp; <span style="color: #800000;">&quot;&quot;</span>, 40)
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;ShipAddress2&quot;</span>, Left(rst!O_Ship2 &amp; <span style="color: #800000;">&quot;&quot;</span>, 40)
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;ShipAddress3&quot;</span>, Left(rst!O_Ship3 &amp; <span style="color: #800000;">&quot;&quot;</span>, 40)
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;ShipAddress4&quot;</span>, Left(rst!O_Ship4 &amp; <span style="color: #800000;">&quot;&quot;</span>, 40)
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;ShipAddress5&quot;</span>, Left(rst!O_Ship5 &amp; <span style="color: #800000;">&quot;&quot;</span>, 40)
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;ShipPostalCode&quot;</span>, Left(rst!O_Ship6 &amp; <span style="color: #800000;">&quot;&quot;</span>, 9) <span style="color: #008000;">'had issues with null values so added the quotes
</span>    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;Email&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;OrderDiscPercent1&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;OrderDiscPercent2&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;OrderDiscPercent3&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;Warehouse&quot;</span>, <span style="color: #800000;">&quot;&quot;</span> <span style="color: #008000;">'rst!O_Warehouse '
</span>    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;SpecialInstrs&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;SalesOrder&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;OrderType&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;MultiShipCode&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;AlternateReference&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;Salesperson&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;Branch&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;Area&quot;</span>, rst!O_Area <span style="color: #008000;">'&quot;&quot;
</span>    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;RequestedShipDate&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;InvoiceNumberEntered&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;InvoiceDateEntered&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;OrderComments&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;Nationality&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;DeliveryTerms&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;TransactionNature&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;TransportMode&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;ProcessFlag&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;TaxExemptNumber&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;TaxExemptionStatus&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;GstExemptNumber&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;GstExemptionStatus&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;CompanyTaxNumber&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;CancelReasonCode&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;DocumentFormat&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;State&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;CountyZip&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;City&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderHeaderNode.NewChild2 <span style="color: #800000;">&quot;eSignature&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    tmpHonApo = rst!O_HonAffPO
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
    <span style="color: #000080;">Set</span> OrderDetailsStockLineNode = OrderDetailsNode.NewChild(<span style="color: #800000;">&quot;StockLine&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>)
&nbsp;
    <span style="color: #008000;">' ad criteria to define the line type in the order import
</span>    <span style="color: #008000;">'get the stock line itmes
</span>    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;CustomerPoLine&quot;</span>, tmpOrderLine
    tmpOrderLine = tmpOrderLine + 1
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;LineActionType&quot;</span>, tmpLineActionType
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;LineCancelCode&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;StockCode&quot;</span>, rst!O_Part
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;StockDescription&quot;</span>, <span style="color: #800000;">&quot;&quot;</span> <span style="color: #008000;">'Left(rst!sDescription &amp; &quot;&quot;, 30)
</span>    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;Warehouse&quot;</span>, rst!O_Warehouse  <span style="color: #008000;">'tmpDefaultWarehouse
</span>    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;CustomersPartNumber&quot;</span>, rst!O_AltPArt &amp;<span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;OrderQty&quot;</span>, rst!O_Qty
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;OrderUom&quot;</span>, rst!stockuom &amp; <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;Price&quot;</span>, IIf(tmpLoadPrice, rst!O_Price, <span style="color: #800000;">&quot;&quot;</span>)
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;PriceUom&quot;</span>, rst!stockuom &amp; <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;PriceCode&quot;</span>, rst!O_PriceList <span style="color: #008000;">'&quot;&quot;
</span>    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;AlwaysUsePriceEntered&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;Units&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;Pieces&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;ProductClass&quot;</span>, rst!productclass &amp; <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;LineDiscPercent1&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;LineDiscPercent2&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;LineDiscPercent3&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;CustRequestDate&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;CommissionCode&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;LineShipDate&quot;</span>, Format(rst!O_LineShipDate, <span style="color: #800000;">&quot;yyyy-mm-dd&quot;</span>)
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;LineDiscValue&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;LineDiscValFlag&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;OverrideCalculatedDiscount&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;UserDefined&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;NonStockedLine&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;NsProductClass&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;NsUnitCost&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;UnitMass&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;UnitVolume&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;StockTaxCode&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;StockNotTaxable&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;StockFstCode&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;StockNotFstTaxable&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;ConfigPrintInv&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;ConfigPrintDel&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
    OrderDetailsStockLineNode.NewChild2 <span style="color: #800000;">&quot;ConfigPrintAck&quot;</span>, <span style="color: #800000;">&quot;&quot;</span>
&nbsp;
    <span style="color: #008000;">'Set OrderDetailsCommentLineNode = OrderDetailsNode.NewChild(&quot;CommentLine&quot;, &quot;&quot;)
</span>    <span style="color: #008000;">'get the comment lines
</span>    <span style="color: #008000;">'OrderDetailsCommentLineNode.NewChild2 &quot;CustomerPoLine&quot;, &quot;2&quot;     'get from recordset
</span>
    <span style="color: #008000;">'Set OrderDetailsMiscChargeLineNode = OrderDetailsNode.NewChild(&quot;MiscChargeLine&quot;, &quot;&quot;)
</span>    <span style="color: #008000;">'get the Misc line details
</span>    <span style="color: #008000;">'OrderDetailsMiscChargeLineNode.NewChild2 &quot;CustomerPoLine&quot;, &quot;3&quot;     'get from recordset
</span>
    <span style="color: #008000;">'Set OrderDetailsFreightLineNode = OrderDetailsNode.NewChild(&quot;FreightLine&quot;, &quot;&quot;)
</span>    <span style="color: #008000;">'get the Freight Line Details
</span>    <span style="color: #008000;">'OrderDetailsFreightLineNode.NewChild2 &quot;CustomerPoLine&quot;, &quot;4&quot;     'get from recordset
</span>
rst.MoveNext <span style="color: #008000;">' goto the next line
</span>
<span style="color: #000080;">Loop</span>
&nbsp;
<span style="color: #008000;">'  Save the XML:
</span><span style="color: #000080;">Dim</span> success <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span>
success = xml.SaveXml(<span style="color: #800000;">&quot;c:\XMLSO.xml&quot;</span>)
<span style="color: #000080;">If</span> (success &lt;&gt;1) <span style="color: #000080;">Then</span>
    MsgBox xml.LastErrorText
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
Exit_Func:
<span style="color: #000080;">Set</span> rst = <span style="color: #000080;">Nothing</span>
<span style="color: #000080;">Set</span> HeaderNode = <span style="color: #000080;">Nothing</span>
<span style="color: #000080;">Set</span> OrderNode = <span style="color: #000080;">Nothing</span>
<span style="color: #000080;">Set</span> OrderHeaderNode = <span style="color: #000080;">Nothing</span>
<span style="color: #000080;">Set</span> OrderDetailsNode = <span style="color: #000080;">Nothing</span>
<span style="color: #000080;">Set</span> OrderDetailsStockLineNode = <span style="color: #000080;">Nothing</span>
<span style="color: #000080;">Set</span> OrderDetailsCommentLineNode = <span style="color: #000080;">Nothing</span>
<span style="color: #000080;">Set</span> OrderDetailsMiscChargeLineNode = <span style="color: #000080;">Nothing</span>
<span style="color: #000080;">Set</span> OrderDetailsFreightLineNode = <span style="color: #000080;">Nothing</span>
&nbsp;
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

<p>The next stage is to use the file created in ExportXML() to pass to Syspro business objects.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Function</span> OrdPost()
<span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">GoTo</span> Errorhandler
<span style="color: #000080;">Dim</span> XMLout, xmlIn, XMLPar
<span style="color: #000080;">Dim</span> xml <span style="color: #000080;">As</span> <span style="color: #000080;">New</span> ChilkatXml
<span style="color: #000080;">Dim</span> rec1 <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> rec2 <span style="color: #000080;">As</span> ChilkatXml
&nbsp;
<span style="color: #000080;">Call</span> ExportXML
&nbsp;
<span style="color: #000080;">Call</span> SysproLogon
&nbsp;
<span style="color: #000080;">Dim</span> EncPost <span style="color: #000080;">As</span> <span style="color: #000080;">New</span> Encore.Transaction
XMLPar = <span style="color: #800000;">&quot;Add the xml parameters here&quot;</span>
&nbsp;
<span style="color: #008000;">'xmlIn = xml.LoadXml(&quot;c:\xmlso.xml&quot;)
</span><span style="color: #000080;">Open</span> <span style="color: #800000;">&quot;c:\xmlso.xml&quot;</span> <span style="color: #000080;">For</span> <span style="color: #000080;">Input</span> <span style="color: #000080;">As</span> #1
xmlIn = <span style="color: #000080;">Input</span>(LOF(1), 1)
<span style="color: #000080;">Close</span> #1
&nbsp;
<span style="color: #008000;">'xml.LoadXmlFile (&quot;c:\XMLSO.xml&quot;)
</span>
<span style="color: #008000;">'actually post the order
</span>XMLout = EncPost.Post(Guid, <span style="color: #800000;">&quot;SORTOI&quot;</span>, XMLPar, xmlIn)
xml.LoadXml (XMLout)
&nbsp;
xml.SaveXml (<span style="color: #800000;">&quot;c:\SORTOIOUT.xml&quot;</span>)
<span style="color: #008000;">'now see if there have been any errors
</span><span style="color: #000080;">Call</span> ReadResults
&nbsp;
<span style="color: #000080;">Exit</span> <span style="color: #000080;">Function</span>
Errorhandler:
&nbsp;
MsgBox Err.Number &amp; <span style="color: #800000;">&quot; &quot;</span> &amp; Err.Description
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

<p>Finally you need to Read the results of the post and update the database</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Function</span> ReadResults()
&nbsp;
<span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">GoTo</span> Errorhandler
<span style="color: #000080;">Dim</span> XMLout, xmlIn, XMLPar
<span style="color: #000080;">Dim</span> xml <span style="color: #000080;">As</span> <span style="color: #000080;">New</span> ChilkatXml
<span style="color: #000080;">Dim</span> rec1 <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> rec2 <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> rec3 <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> rec4 <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> rec5 <span style="color: #000080;">As</span> ChilkatXml
<span style="color: #000080;">Dim</span> rst <span style="color: #000080;">As</span> Recordset, tmpReason, tmpSql
&nbsp;
<span style="color: #000080;">Dim</span> tmpMEssage1
<span style="color: #000080;">Dim</span> tmpMessage2, tmpOrder, tmpStkCode, tmpMessage(20)
<span style="color: #000080;">Dim</span> x
&nbsp;
xml.LoadXMLFile (<span style="color: #800000;">&quot;c:\SORTOIOUT.xml&quot;</span>)
<span style="color: #008000;">'search for status
</span><span style="color: #000080;">Set</span> rec4 = xml.SearchForTag(<span style="color: #000080;">Nothing</span>, <span style="color: #800000;">&quot;SalesOrder&quot;</span>)
tmpMessage(2) = rec4.Content
&nbsp;
<span style="color: #008000;">'mark order processed if we have a sales order number
</span><span style="color: #000080;">If</span> Len(tmpMessage(2) &amp; <span style="color: #800000;">&quot;&quot;</span>) &gt; 0 <span style="color: #000080;">Then</span>
    CurrentDb.Execute (<span style="color: #800000;">&quot;UPDATE tblImportData SET O_Processed = -1 WHERE  O_Number=&quot;</span> &amp; Chr(34) &amp; tmpPorder &amp; Chr(34) &amp; <span style="color: #800000;">&quot; AND O_Entity=&quot;</span> &amp; Chr(34) &amp; tmpPcountry &amp; Chr(34))
&nbsp;
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
<span style="color: #000080;">If</span> Len(tmpMessage(2) &amp; <span style="color: #800000;">&quot;&quot;</span>) = 0 <span style="color: #000080;">Then</span>
    <span style="color: #000080;">Set</span> rec4 = xml.SearchForTag(<span style="color: #000080;">Nothing</span>, <span style="color: #800000;">&quot;Status&quot;</span>)
    tmpMessage(1) = rec4.Content
&nbsp;
    <span style="color: #008000;">'search for Errormessages
</span>    <span style="color: #000080;">Set</span> rec4 = xml.SearchForTag(<span style="color: #000080;">Nothing</span>, <span style="color: #800000;">&quot;ErrorDescription&quot;</span>)
    tmpMessage(3) = rec4.Content
&nbsp;
    <span style="color: #008000;">' Find the first article beginning with M
</span>    <span style="color: #000080;">Set</span> rec1 = xml.SearchForTag(<span style="color: #000080;">Nothing</span>, <span style="color: #800000;">&quot;Customer&quot;</span>)
    tmpMessage(4) = rec1.Content
    Debug.<span style="color: #000080;">Print</span> tmpMessage(4)
&nbsp;
    <span style="color: #000080;">Set</span> rec1 = xml.SearchForTag(<span style="color: #000080;">Nothing</span>, <span style="color: #800000;">&quot;CustomerPoNumber&quot;</span>)
&nbsp;
    tmpMessage(5) = rec1.Content
    Debug.<span style="color: #000080;">Print</span> tmpMessage(5)
&nbsp;
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
<span style="color: #008000;">'write the overall status
</span><span style="color: #000080;">Set</span> rst = CurrentDb.OpenRecordset(<span style="color: #800000;">&quot;tblResults&quot;</span>)
<span style="color: #000080;">With</span> rst
    .AddNew
    !R_Customer = tmpPcountry
    !R_Order = tmpPorder
    !R_StockCode = <span style="color: #800000;">&quot;&quot;</span>
    !R_Error = tmpMessage(1) &amp; <span style="color: #800000;">&quot; Reason: &quot;</span> &amp; tmpMessage(3)
    !R_SYSOrder = tmpMessage(2)
    !R_MAster = <span style="color: #800000;">&quot;Y&quot;</span>
    !R_Added = Now()
    .Update
<span style="color: #000080;">End</span> <span style="color: #000080;">With</span>
<span style="color: #000080;">Set</span> rst = <span style="color: #000080;">Nothing</span>
&nbsp;
<span style="color: #000080;">Set</span> rec2 = xml.SearchForTag(rec1, <span style="color: #800000;">&quot;StockCode&quot;</span>)
&nbsp;
<span style="color: #000080;">Do</span> <span style="color: #000080;">While</span> <span style="color: #000080;">Not</span> rec2 <span style="color: #000080;">Is</span> <span style="color: #000080;">Nothing</span>
&nbsp;
    tmpMessage(6) = rec2.Content
    Debug.<span style="color: #000080;">Print</span> tmpMessage(6)
&nbsp;
    <span style="color: #000080;">Set</span> rec3 = xml.SearchForTag(rec2, <span style="color: #800000;">&quot;ErrorMessages&quot;</span>)
    <span style="color: #000080;">Do</span> <span style="color: #000080;">While</span> <span style="color: #000080;">Not</span> rec3 <span style="color: #000080;">Is</span> <span style="color: #000080;">Nothing</span>
        <span style="color: #000080;">Set</span> rec4 = rec3.SearchForTag(<span style="color: #000080;">Nothing</span>, <span style="color: #800000;">&quot;ErrorDescription&quot;</span>)
        x = 6
        <span style="color: #000080;">Do</span> <span style="color: #000080;">While</span> <span style="color: #000080;">Not</span> rec4 <span style="color: #000080;">Is</span> <span style="color: #000080;">Nothing</span>
            x = x + 1
            tmpMessage(x) = rec4.Content
            Debug.<span style="color: #000080;">Print</span> tmpMessage(x)
&nbsp;
            <span style="color: #008000;">'find the next message
</span>            <span style="color: #000080;">Set</span> rec4 = rec3.SearchForTag(rec4, <span style="color: #800000;">&quot;ErrorDescription&quot;</span>)
        <span style="color: #000080;">Loop</span>
        <span style="color: #000080;">Set</span> rec3 = rec2.SearchForTag(rec3, <span style="color: #800000;">&quot;ErrorMessages&quot;</span>)
    <span style="color: #000080;">Loop</span>
&nbsp;
    <span style="color: #008000;">'nowWrite the Results if an error occurred
</span>    <span style="color: #000080;">If</span> Len(tmpMessage(4) &amp; <span style="color: #800000;">&quot;&quot;</span>) &gt; 0 <span style="color: #000080;">Then</span>
        <span style="color: #000080;">Set</span> rst = CurrentDb.OpenRecordset(<span style="color: #800000;">&quot;tblResults&quot;</span>)
        <span style="color: #000080;">With</span> rst
        <span style="color: #000080;">Do</span> <span style="color: #000080;">While</span> x &gt;= 7
            .AddNew
            !R_Customer = tmpPcountry
            !R_Order = tmpPorder
            !R_StockCode = tmpMessage(6)
            !R_Error = tmpMessage(x)
            !R_MAster = <span style="color: #800000;">&quot;N&quot;</span>
            !R_Added = Now()
            .Update
            tmpMessage(x) = <span style="color: #800000;">&quot;&quot;</span>
            x = x - 1
        <span style="color: #000080;">Loop</span>
        <span style="color: #000080;">End</span> <span style="color: #000080;">With</span>
        <span style="color: #000080;">Set</span> rst = <span style="color: #000080;">Nothing</span>
    <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
<span style="color: #000080;">Set</span> rec2 = xml.SearchForTag(rec2, <span style="color: #800000;">&quot;StockCode&quot;</span>)
<span style="color: #000080;">Loop</span>
&nbsp;
<span style="color: #008000;">'now update syspro results
</span><span style="color: #000080;">Call</span> UpdateArea
&nbsp;
<span style="color: #000080;">Exit</span> <span style="color: #000080;">Function</span>
&nbsp;
Errorhandler:
&nbsp;
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://accountingsystems.ie/?feed=rss2&amp;p=8</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
