i have a stored procedure which can add the comment ids on every purchase order lines in GP. But the issue is I am using VBA AND I want THAT WHENEVER USER ENTERS a new Purchase Order in GP with few line items and as user click on save Button. It should call my stored procedure to add comment id for every line item automatically. Note that this PO is a new PO so It was not existed before so I want that VBA First saves the PO and after that VBA should call my SQL Stored procedure along with the paramter PONumber so that My stored procedure will add comment ids for every po line items. I am trying my level best. but I don't know how to do that : The code i have written down in VBA IS BUT IT IS NOT WORKING . Can ANYBODY Help me, will appreciate help
Public Sub Save_AfterUserChanged()
Dim rs As ADODB.RecordSet
Dim sDocNumber As Variant
'dim abc as
Set rs = New ADODB.RecordSet
'Assign Values to Local Variable
'===============================
sDocNumber = sDocNumber1
'Create RecordSet
'=================================
Set rs = CreateObject("ADODB.Recordset")
'Use RecordSet to execute Stored Procedure and pass in the variables to the Parameter
'=====================================================================================
rs.Open "EXEC RMC_Fill_CommentID1 '" & sDocNumber & "'", GetConnection()
'rs.Open "EXEC RMC_Fill_CommentID1 '" & "P00022795" & "'", GetConnection()
End Sub
*This post is locked for comments