Solved

Three Questions

Posted on 2003-11-09
3
214 Views
Last Modified: 2012-05-04
1)can anybody give me a code on using MSComm1 to call a telephone number, for now I have this:

Private Sub Form_Load()
  MSComm1.PortOpen = True
  MSComm1.Output = ("AT DT 000000")
End Sub

but it never do anything, I did put the correct Comm Port, and it works in Phone Dialer but not in VB...

2) I need a way to check if connection to the net is established, I need it to work in any case, (when a PC is recieving connection from another computer through LAN NETWORK, I need the program to know that their is connection)
thx

3)
SELECT CASE QUESTION

I have more than 25 IF...THEN statments and I want to make then Select Case but the problem is the statments are

If Left$(text1.text, 3) = "msg" then
msgbox "message!"
end if
if left$(text1.text,4)="help" then
msgbox "help"
end if
...

so Select case isnt working :(

I thought of something similar to this:

x = Len(CASES)
Select Case Left$(Text1.Text, x)
Case "msg"
MsgBox "MESSAGE!"
Case "help"
MsgBox "HELP!"
End Select

but there is nothing called Len(CASES)

any help?
0
Comment
Question by:deathman5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 9710382
Question 3

x = LenB(Text1.Text)

or this should work

Select Case Text1.Text


or if not are the first 3 characters different for each case
Select Case Left$(Text1.Text, 3)

mlmcc
0
 
LVL 2

Accepted Solution

by:
MaxPol earned 50 total points
ID: 9713938
1) have you verified that the post is not already opened?

Have you specified the port correctly?
 - MSComm1.CommPort

Have you checked for any error after you open it?

Try adding a vbCrLf as follow:

 - MSComm1.Output = ("AT DT 000000") & vbCrLf

Bye,

Max
0
 

Author Comment

by:deathman5
ID: 9723809
@mlmcc
nop not that, that will get len of all text I need the len of the cases...
thx anyway

@MaxPol
yup it worked, I have another question that I'll post about it, hope u read it!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question