ISTech Support Forum
http://www.istechforum.com/YaBB.pl
Evo-ERP and DBA Classic >> Sales >> IMPORTING SALES ORDERS
http://www.istechforum.com/YaBB.pl?num=1351705496

Message started by carolg on 10/31/12 at 10:44:56

Title: IMPORTING SALES ORDERS
Post by carolg on 10/31/12 at 10:44:56

We have to prepare a sales order with about 100 lines.  Any way we can put it into a spreadsheet and import it?

Title: Re: IMPORTING SALES ORDERS
Post by Kelloggs on 10/31/12 at 12:59:33

Are you planning to import SO data on a regular basis? or it is a one time thing

:-?

Kelloggs

PD: that post is from 2009!!!

http://www.istechforum.com/YaBB.pl?num=1249917161/2#2

Title: Re: IMPORTING SALES ORDERS
Post by carolg on 11/01/12 at 12:19:20

I'm hoping this is a one time occurrence but may want to use it in the future

Title: Re: IMPORTING SALES ORDERS
Post by Kelloggs on 11/02/12 at 11:18:19

I can create a ms excel app that would do it.

Let me know if you interested.

8-)

Kelloggs

Title: Re: IMPORTING SALES ORDERS
Post by carolg on 11/02/12 at 11:27:19

Thanks. Good to know.

Title: Re: IMPORTING SALES ORDERS
Post by Kelloggs on 11/02/12 at 11:56:36

With a little bit of imagination it can be done. Example
This will validate  your "Parts" before attempting  to export your data to DBA. You should change the ODBC Name, Sheet Name and Range.

:P

Option Explicit
Public var_sql As String
Public Response As Integer
Public conn As New ADODB.Connection
Public rs As New ADODB.Recordset
Public cmd As New ADODB.Command

Public Sub USE_IT_TO_TEST()
   'Test Run
   MsgBox validate_sku
End Sub

Public Function validate_sku() As Boolean
Dim rng As Range
Dim row As Range
Dim cell As Range

Set rng = Sheets("Main").Range("C5:C100") 'CHANGE HERE

For Each row In rng.Rows
 For Each cell In row.Cells
   
       If row.Value <> "" Then
           var_sql = "SELECT Count(*) as CC FROM BKICMSTR WHERE BKIC_PROD_CODE='" & row.Value & "'"
           If tc_tf(var_sql) = False Then
               validate_sku = False
               Response = MsgBox("Unable to Find SKU on DBA. ", vbCritical, " Saturn")
               Exit Function
           End If
           'All entries on Sheet Are valid
           validate_sku = True
       End If
       validate_sku = True
 Next cell
Next row
End Function

Public Function tc_tf(the_sql As String) As Boolean
conn.CursorLocation = adUseClient
conn.Open "provider=MSDASQL;dsn=" & "DBA"  'CHANGE HERE
rs.Open the_sql, conn, adOpenStatic
   
If rs("CC") <> 0 Then
   tc_tf = True
Else
   tc_tf = False
End If
   
rs.Close
conn.Close
End Function

ISTech Support Forum » Powered by YaBB 2.1!
YaBB © 2000-2005. All Rights Reserved.