Question: Below is a function I have in SalesLogix and there seems to be a problem with my ‘End With’. Suggestions?
Sub PopulateEmp(Sender)
Dim strQ
Dim strC
Dim oShell
Dim tUserID
Dim tAccountID
Dim tCreateUser
Dim tModifyUser
tUserID = application.basicfunctions.
tAccountID = frmAccountDetail.CurrentID
tCreateUser = application.basicfunctions.
tModifyUser = application.basicfunctions.
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 = 1 Then
tbxEmployeeTotal.Text = .Fields(“EMPLOYEETOTAL”).Value
Else IF .RecordCount = 0 Then
tbxEmployeeTotal.Text = “”
End If
.Close
End With
Set rs = Nothing
End Sub
If .RecordCount = 1 Then
tbxEmployeeTotal.Text = .Fields(“EMPLOYEETOTAL”).Value
Else IF .RecordCount = 0 Then
tbxEmployeeTotal.Text = “”
End If
to this:
If .RecordCount = 1 Then
tbxEmployeeTotal.Text = .Fields(“EMPLOYEETOTAL”).Value
ElseIf .RecordCount = 0 Then
tbxEmployeeTotal.Text = “”
End If



