When performing lengthy updates in the SalesLogix client, it's a good idea to provide the user with some degree of feedback so that it doesn't appear as though SalesLogix has locked up. The Progress Bar control, can be used for this purpose:
Progress Bar
The main properties in this control you will want to set are the "Max" and "Position" properties. "Max" defines the upper limit of the bars position. "Position" defines the current position of the bar. Basically, we just need to set "Max" to the count of records modified, and then need to increment the "Position" value by one for each record we update.
In this simple example, I'm simply running through the Account table, and setting the status value from each record to "Open" when it doesn't already have that status.
Sub UpdateAccounts
Dim rs
Set rs = CreateObject("ADODB.Recordset")
With rs, pos
pos = 0
Set .ActiveConnection = Application.GetNewConnection
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open "select * from Account where status <> 'Open'"
ProgressBar1.Max = .RecordCount
ProgressBar1.Position = pos
.MoveFirst
While Not (.Bof or .Eof)
.Fields("modifyuser").Value = Application.BasicFunctions.CurrentUserID
.Fields("modifydate").Value = Now
.Fields("status").Value = "Open"
.Update
pos = pos + 1
ProgressBar1.Position = pos
.MoveNext
Wend
.Close
End With
Set rs = Nothing
End Sub
That's all there is to it. Users will now be able to visually follow the progress of the update. I hope you found this code sample helpful! 