Hi

I need your help. I have the need to add some code for making a reference to an Active X control. I am not a programmer, but my supplier has given me this sample code. Could you please help me?

This code is for an external CTI application which will pop up the contact module or the activities module in order to type some information on it when a call arrives:

The sample code is this (I think is Visual Basic):


Option Explicit
Dim WithEvents tlp As TlpFormMD.TlpFormMultiDialer

Private Sub cmdGuardar_Click()
tlp.Name = txtNom.Text
tlp.Phone = txtNum.Text
Dim i As Integer
For i = 1 To 24
tlp.Dato(i) = txtDat(i).Text
Next i
tlp.SendRecord

Dim DB As Database, cadSQL As String
Set DB = OpenDatabase(App.Path & "\Base.mdb")

cadSQL = "update cliente set " _
& "nombre='" & mdbNom.Text & "'," _
& "direccion='" & mdbDir.Text & "', " _
& "telefono='" & mdbTel.Text & "'," _
& "dni='" & mdbDni.Text & "'," _
& "email='" & mdbEmail.Text & "' " _
& "where id=" & tlp.Dato(1)

Debug.Print cadSQL
DB.Execute (cadSQL)

DB.Close
Set DB = Nothing
End Sub

Private Sub cmdLimpiar_Click()
VaciarCampos
End Sub

Private Sub tlp_IncomingCall()
VaciarCampos

txtNom.Text = tlp.Name
txtNum.Text = tlp.Phone
Dim i As Integer
For i = 1 To 24
txtDat(i).Text = tlp.Dato(i)
Next i

Dim DB As Database
Dim RS As Recordset

Set DB = OpenDatabase(App.Path & "\Base.mdb")
Set RS = DB.OpenRecordset("select * from cliente where id=" & tlp.Dato(1))

If Not RS.EOF And Not RS.BOF Then
frm.Caption = "Datos del Cliente"
mdbNom.Text = RS("nombre")
mdbDir.Text = RS("direccion")
mdbTel.Text = RS("telefono")
mdbDni.Text = RS("dni")
mdbEmail.Text = RS("email")
Else
frm.Caption = "Datos del Cliente NO SE ENCONTRARON en BASE.MDB"
End If

RS.Close
DB.Close
Set DB = Nothing
End Sub

Private Sub VaciarCampos()
txtNom.Text = ""
txtNum.Text = ""
Dim i As Integer
For i = 1 To 24
txtDat(i).Text = ""
Next i
frm.Caption = "Datos del Cliente"
mdbNom.Text = ""
mdbDir.Text = ""
mdbTel.Text = ""
mdbDni.Text = ""
mdbEmail.Text = ""
End Sub

Private Sub Form_Load()
Set tlp = New TlpFormMD.TlpFormMultiDialer
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set tlp = Nothing
End Sub
[/FONT]

The above sample code is intended for opening a MDB file and presenting the information of the people calling.


The explanation of events and properties are these:

IncomingCall
This event tells when a call is made. In this moment data must be obtained sent by Teleprom® IPT MultiDialer for linking with the Sugar software.
To obtain this data must see the properties Name, Phone and Dato.


SendRecord
In every call, the Active EXE control provides data from Teleprom® IPT MultiDialer. This procedure is intended to return data to Teleprom® IPT MultiDialer once they have been updated or modified by an operator.
Note: See properties Name, Phone and Dato.


Connected – Reading only
This property sends back the connection state between Teleform MultiDialer software and Teleprom® IPT MultiDialer hardware.
True if it is connected, False If it's not.


Dato (Index as Integer)
This property sends back or stablish value in the Dato X column from Teleprom® IPT MultiDialer, where X is an index going from 1 to 24.

Name
This property sends back or stablish the value in the Name column from Teleprom® IPT MultiDialer software

OperatorID – Reading only
This property sends back the number in which the operator was logged in to Teleprom® IPT MultiDialer.

Phone
This property sends back or stablish the value in the Telephone column in the Teleprom® IPT MultiDialer software. This is the number used for dialing.

RemoteHost – Reading only
This property sends back the name of the PC in which it is logged in the operator. That is, the PC where it is executed the Teleprom® IPT MultiDialer software.

TimeToHangUp – Reading only
This property sends back, in seconds, the time limit time for talking that a operator has in a telephone conversation.

TimeToPickUp – Reading only
This property sends back, in seconds, the time limit that the operator has to attend a phone call.

TimeToType – Reading only
This property sends back in seconds, the time limit that the operator has for typing extra information, after a call has been hang up.


It is important to mention that I do not know how to integrate this code and what tables or database I must refer. I am not a programmer, so ANY information could be highly appreciated. Thank you!!!
. I have about 2 years trying to deal with this issue but still I do not know how.