Hello, I have a button when clicked executes a stored procedure and populates a window and grid. I want to be able to check the user against a table and only allow the procedure to run if the user is in the table. Any Ideas how I can accomplish this?
Here is the code I'm working with:
Private Sub PushButtonM162_AfterUserChanged()
On Error GoTo ErrorHandler
CancelLogic = True
Dim userinfo As New RetrieveGlobals.retrieveuserinfo
Dim adCNN As ADODB.Connection
Dim adrst As ADODB.Recordset
Dim strcmd As String
Dim strCnn As String
Dim response As Variant
sqluid = userinfo.retrieve_user()
sqlpwd = userinfo.sql_password()
SQLdb = userinfo.intercompany_id()
sqlsvr = userinfo.sql_datasourcename()
With CLIN_Filter
.User = sqluid
.password = sqlpwd
.SERVER = sqlsvr
.DataBase = SQLdb
.Filter_Type = "CLIN"
.Height = 7000
.dHeight = 3750
.Width = 8500
.dWidth = 7800
' .blindLU = True
.addSorts = 2
.reportCount = 4
'.param = SalesTransactionEntryDetail.ItemNumber.Value
.sp_Name = "csp_ws_lookup_item_clin_Only70"
response = .load_view
CLIN_Filter_RowReturned response
End With
Exit Sub
ErrorHandler:
Exit Sub
Here is the code I'm working with:
Private Sub PushButtonM162_AfterUserChanged()
On Error GoTo ErrorHandler
CancelLogic = True
Dim userinfo As New RetrieveGlobals.retrieveuserinfo
Dim adCNN As ADODB.Connection
Dim adrst As ADODB.Recordset
Dim strcmd As String
Dim strCnn As String
Dim response As Variant
sqluid = userinfo.retrieve_user()
sqlpwd = userinfo.sql_password()
SQLdb = userinfo.intercompany_id()
sqlsvr = userinfo.sql_datasourcename()
With CLIN_Filter
.User = sqluid
.password = sqlpwd
.SERVER = sqlsvr
.DataBase = SQLdb
.Filter_Type = "CLIN"
.Height = 7000
.dHeight = 3750
.Width = 8500
.dWidth = 7800
' .blindLU = True
.addSorts = 2
.reportCount = 4
'.param = SalesTransactionEntryDetail.ItemNumber.Value
.sp_Name = "csp_ws_lookup_item_clin_Only70"
response = .load_view
CLIN_Filter_RowReturned response
End With
Exit Sub
ErrorHandler:
Exit Sub