Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 18, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Lock down single text box / Function not working
NebSeb
Posts: 49
 
Lock down single text box / Function not workingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jan 08 5:06 PM
I have two problems. One is I need to lock down a text box so only the two people in the company can change thier values based on their TITLE. Second the following code is returning this error when i change the value of the text box in SLX.

Error:
Multiple-step operation generaged errors. Check each status Value. at Line 906, Char 10
.Fields("EMPLOYEETOTAL").Value = tbxEmployeeTotal.Text--> this would be the offending line of code.

AM I doing something wrong when i try to assign the value it needs to write to the DB?

Basically the text box's value is whatever is stored in the DB for that account, then if they change it it needs to write the new value to the db.
SO i have it do that on the "OnChange" event. Should I do this another way?

Thanks.

Sub tbxEmployeeTotalChange(Sender)
Dim strSQL
Dim strQ
Dim strC
Dim oShell
Dim tUserID
Dim tAccountID
Dim tCreateUser
Dim tModifyUser

tUserID = application.basicfunctions.CurrentUserID
tAccountID = frmAccountDetail.CurrentID
tCreateUser = application.basicfunctions.CurrentUserID
tModifyUser = application.basicfunctions.CurrentUserID

Set rs = CreateObject("ADODB.Recordset")
With rs
Set .ActiveConnection = Application.GetNewConnection
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open "select * from EMPLOYEE where ACCOUNTID = '" & tAccountID & "'"

If .RecordCount = 0 Then
.AddNew
.Fields("ACCOUNTID").Value = tAccountID
.Fields("CREATEUSER").Value = tUserID
.Fields("CREATEDATE").Value = Now

End If

.Fields("MODIFYUSER").Value = tUserID
.Fields("MODIFYDATE").Value = Now
.Fields("EMPLOYEETOTAL").Value = tbxEmployeeTotal.Text
.Update
.Close
End With
Set rs = Nothing
End Sub
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Lock down single text box / Function not workingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jan 08 5:32 PM
What is the value in txtEmployeeTotal.Text and what is the datatype of EMPLOYEETOTAL?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Lock down single text box / Function not workingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jan 08 5:35 PM
BTW, the txtEmplyeeTotal isn't bound, is it? Also, I wouldn't necessarily do it this way. Why not just bind the control and then enable/disable the control based on the rules for who can edit it? Either way, I wouldn't use the Change event of the control, I'd use the Exit event of the control instead (that is, if there are requirements that make binding the control and then only enabling it for the appropriate users not a workable solution)

-Ryan
[Reply][Quote]
NebSeb
Posts: 49
 
Re: Lock down single text box / Function not workingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jan 08 5:37 PM
The value is 99 and it is a float, but i realized after looking at the code i had elsewhere i was trying to call a change event for the textobx and it didnt like it. So it is resolved.

My only issue now is just how I would go about locking down specific textboxes on the account details form so they can only be changed by specific people.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/18/2025 10:56:49 AM