This idea have been very useful to us. The Ext UDF is capable of passing "values" to any external program.
Right inside EVO we are able to call any supporting application now.
We use it to call our own "Non-Conformance" and "Pressure Testing Reports" Application, among others.
And by converting the Grid into a Program we are able to create our own menus.
But there is a problem, if
Allen can have the "External Call" button to close the grid would be great! because right now it stays open.
On the "WORKORDERS" Grid we are calling "wo_link.exe" Evo is passing the MTWO_WIP_WOPRE and MTWO_WIP_WOSUF as parameters.
Here is the code (VB6)
Dim var_sql As String
'------------------------------------------
'------------------------------------------
Public odbc_msa As String
Public conn_msa As New ADODB.Connection
Public rs_msa As New ADODB.Recordset
Public cmd_msa As New ADODB.Command
'------------------------------------------
'------------------------------------------
Public Sub Main()
Dim dblProcesID As Double
Dim WrdArray() As String
app_db = App.Path & "\wo_link.mdb" 'Your ms access database
app_exe = "C:\Program Files (x86)\Microsoft Office\OFFICE11\MSACCESS.EXE " 'Path to your MS Access Executable Note there is a space at the end
odbc_msa = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & app_db & ";" '12.0 for MS Access 2003
'Evo's Parameters
WrdArray() = Split(Command$)
For i = LBound(WrdArray) To UBound(WrdArray)
If i = 0 Then
wo_pre = WrdArray(i)
Else
If i = 2 Then
wo_suf = WrdArray(i)
End If
End If
Next i
'Delete Previus Record
var_sql = "DELETE FROM local_link;"
msa_conn (var_sql)
'Insert New Record
var_sql = "INSERT INTO local_link (wo_pre, wo_suf) VALUES (" & wo_pre & "," & wo_suf & ");"
msa_conn (var_sql)
'Open DB
dblProcesID = Shell(app_exe & app_db, vbNormalFocus)
'Exit App
End
End Sub
Public Sub msa_conn(the_sql As String)
conn_msa.ConnectionString = odbc_msa
conn_msa.Open
Set cmd_msa.ActiveConnection = conn_msa
cmd_msa.CommandText = the_sql
cmd_msa.Execute
conn_msa.Close
End Sub
Kelloggs