Me Again! Are you sick of me yet?
anyway, i'm trying to make it a little further with my new call answering database at work.
Basically it consists of a main form that has a button leading to a call answering form for each business that we represent. it also has a text box that displays the number of the caller when the telephone picks up, the correct call answering screen is also popped by the telephone software and a macro whenever the phone is answered.
i've got code in place that automatically puts the date and time in the correct field and also copy the incoming telephone number from the main form into the caller number field on the call answering form.
i'd like to take this automation a little further now and get the form to autopopulate the caller details if that caller has called before (we get a lot of calls from the same people) so i'd like to make the form search the table it's linked to for the incoming phone number and to fill in the name, email, company etc... for the caller according to the previous record.
i've tried searching online so i'm not just torturing you lot but i must be phrasing it wrong as i'm not coming up with anything. i even had a look through your code repository (it blew my mind with what you can do in access) but i couldn't find anything that looks like it could help me.
the code for the 2 forms i've currently got setup (the switchboard and one call answering screen) are as follows
Switchboard:-
The call answering screen:-
this is the code from the script file that pops the screens (i didn't write this, i just played about with it)
any help or links to information where i could at least get a toe in will be very much appreciated.
Wayne
anyway, i'm trying to make it a little further with my new call answering database at work.
Basically it consists of a main form that has a button leading to a call answering form for each business that we represent. it also has a text box that displays the number of the caller when the telephone picks up, the correct call answering screen is also popped by the telephone software and a macro whenever the phone is answered.
i've got code in place that automatically puts the date and time in the correct field and also copy the incoming telephone number from the main form into the caller number field on the call answering form.
i'd like to take this automation a little further now and get the form to autopopulate the caller details if that caller has called before (we get a lot of calls from the same people) so i'd like to make the form search the table it's linked to for the incoming phone number and to fill in the name, email, company etc... for the caller according to the previous record.
i've tried searching online so i'm not just torturing you lot but i must be phrasing it wrong as i'm not coming up with anything. i even had a look through your code repository (it blew my mind with what you can do in access) but i couldn't find anything that looks like it could help me.
the code for the 2 forms i've currently got setup (the switchboard and one call answering screen) are as follows
Switchboard:-
Code:
Option Compare Database
Dim WithEvents MaxxCom As Metro_MaxxCom_CTI_COM_API.CTI
Private Sub cmd_onnet_Click()
DoCmd.OpenForm FormName:="On_Net_Communications"
End Sub
Private Sub Form_Load()
Set MaxxCom = CreateObject("MaxxDTC.CTI")
End Sub
Private Sub MaxxCom_Established(ByVal Call_ID As String, ByVal Answering_Internal_Ext As String, ByVal Answering_Outside_Number As String, ByVal Answering_Device_Type As Metro_MaxxCom_CTI_COM_API.DeviceCategories, ByVal Internal_Calling_Ext As String, ByVal Outside_Caller_Number As String, ByVal Trunk_Outside_Number As String, ByVal Calling_Device_Type As Metro_MaxxCom_CTI_COM_API.DeviceCategories, ByVal Originally_Called_Dev As String, ByVal Last_Redirection_Ext As String, ByVal Local_Connection_State As Metro_MaxxCom_CTI_COM_API.LocalConnectionStates, ByVal Event_Cause As Metro_MaxxCom_CTI_COM_API.EventCauses)
txt_incoming.Value = Outside_Caller_Number
End Sub
The call answering screen:-
Code:
Option Compare Database
Private Sub cmd_recordcomplete_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close acForm, Me.Name
End Sub
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
txt_dateandtime.Value = Now
Me.txt_callertelephone.Value = Forms!Switchboard!txt_incoming.Value
Forms!Switchboard!txt_incoming.Value = ""
End Sub
this is the code from the script file that pops the screens (i didn't write this, i just played about with it)
Code:
Option Strict On
Imports Metro.MaxxCom.CTI.Scripting.CTI
Module Script
#Region "Initialization Code - Do not remove"
'This code is required for the script to function correctly - do not edit or remove!
Private WithEvents CTI As Metro.MaxxCom.CTI.Scripting.CTI
Public Sub Initialize(ByVal objCTI As Metro.MaxxCom.CTI.Scripting.CTI)
CTI = objCTI
End Sub
#End Region
Private Sub CTI_Established(ByVal sender As Object, ByVal e As Metro.MaxxCom.CTI.Client.Monitor.EstablishedEventArgs) Handles CTI.Established
If e.Trunk_Outside_Number <> "" Then
If CTI.AppActivate("Call Answering Switchboard", AppActivateCriteria.Contains) Then
CTI.SendKeys("%TMM") 'Run Macro
System.Threading.Thread.Sleep(100)
CTI.SendKeys(e.Trunk_Outside_Number & "{Enter}")
End If
End If
End Sub
End Module
any help or links to information where i could at least get a toe in will be very much appreciated.
Wayne