sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Cenfus's Avatar

Dialling out from Access


Question posted by: Cenfus (Guest) on July 13th, 2006 05:45 PM
(Access 2000, that is).

I have a table with phone numbers in it.
How do I have an Access form or macro pick up a single number that's
displayed in a form and pass it to the dialler ("C:\Program
Files\Windows NT\dialer.exe") ?

Really grateful if anyone can point me in the right direction. It
would really speed up use of my address book.

Many thanks in advance, from Clifton in Bristol.

1 Answer Posted
salad's Avatar
Guest - n/a Posts
#2: Re: Dialling out from Access

Cenfus wrote:
Quote:
Originally Posted by
(Access 2000, that is).
>
I have a table with phone numbers in it.
How do I have an Access form or macro pick up a single number that's
displayed in a form and pass it to the dialler ("C:\Program
Files\Windows NT\dialer.exe") ?
>
Really grateful if anyone can point me in the right direction. It
would really speed up use of my address book.
>
Many thanks in advance, from Clifton in Bristol.
>

If you open up a form in Design mode, click on the toolbox and select
the command button. When the wizard comes up, select Miscellaneous,
then AutoDialer. It will write out the code for you but it expects the
previous control to be the phone number. If you can code, you can
modify it to work otherwise Here's the code generated by the wizard.

Private Sub Command7_Click()
On Error GoTo Err_Command7_Click

Dim stDialStr As String
Dim PrevCtl As Control
Const ERR_OBJNOTEXIST = 2467
Const ERR_OBJNOTSET = 91

Set PrevCtl = Screen.PreviousControl

If TypeOf PrevCtl Is TextBox Then
stDialStr = IIf(varType(PrevCtl) V_NULL, PrevCtl, "")
ElseIf TypeOf PrevCtl Is ListBox Then
stDialStr = IIf(varType(PrevCtl) V_NULL, PrevCtl, "")
ElseIf TypeOf PrevCtl Is ComboBox Then
stDialStr = IIf(varType(PrevCtl) V_NULL, PrevCtl, "")
Else
stDialStr = ""
End If

Application.Run "utility.wlib_AutoDial", stDialStr

Exit_Command7_Click:
Exit Sub

Err_Command7_Click:
If (Err = ERR_OBJNOTEXIST) Or (Err = ERR_OBJNOTSET) Then
Resume Next
End If
MsgBox Err.Description
Resume Exit_Command7_Click

End Sub

You could change it to

Private Sub Command7_Click()
On Error GoTo Err_Command7_Click

'assumes the form's textbox name is PhoneNumber
Application.Run "utility.wlib_AutoDial", Me.PhoneNumber

Exit_Command7_Click:
Exit Sub

Err_Command7_Click:
MsgBox Err.Description
Resume Exit_Command7_Click

End Sub
 
Not the answer you were looking for? Post your question . . .
197,029 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 197,029 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors