Hello Friends,

I am trying this code to receive SMS through my GSM Modem but I just get this:

AT+CMGL="ALL"

OK

in the text2 box

Please help

Private Sub Command2_Click()
Dim buffer
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
With MSComm1
.CommPort = 3
.Settings = "9600,N,8,1"
.InputLen = 0
.Handshaking = comNone

.PortOpen = True
End With
MSComm1.Output = "AT" & vbCrLf
Do
DoEvents
buffer = MSComm1.Input
Loop Until InStr(buffer, "OK")
buffer = ""
MSComm1.Output = "AT+CMGF=1" & vbCrLf
Do
DoEvents
buffer = MSComm1.Input
Loop Until InStr(buffer, "OK")
buffer = ""
MSComm1.Output = "AT+CMGL=" & Chr(34) & "ALL" & Chr(34) & vbCrLf
Do
DoEvents
buffer = buffer & MSComm1.Input
Loop Until InStr(buffer, "OK")

Text2.Text = buffer
End Sub

Thanking u all in advance.

RTFM. If you have not any you should have a software from modem vendor so do little reverse engineering - line dump when receiving sms manually and find secret of the steel.