Make your own free website on Tripod.com

Page 17

 

Home
Up

  If Len(sDigits) = 10 Then

    Me.Cls

    Me.Print "Receiving :" & sDigits

    ' 10 digits number need to be checkd against Number in the DB

                 

   'SELECT Name from numberInfo where Number = "sDigits"

   ' Fuunction

   iName = GetNextRecord(sDigits)

   MSComm1.Output = sDigits + iName + Chr(13)

   Me.Cls

   Me.Print "Sending :" & sDigits

   sDigits = ""      ' Clear the string for next code

   End If

 End If

 

End Sub

 

Public Function GetNextRecord(ByVal criteria As String) As String

'Open the recordset and select the next record

OpenDB (App.Path & "\Pass-Number.mdb")

'Private declarations for the database and recordset

Private db As Database

Private RS As Recordset

Dim iName As String

Set RS = db.OpenRecordset("SELECT Number, Name FROM numberInfo _

"WHERE Number = "'" & criteria "'")

Number = sDigits

If RS.bof Or re.EOF Then

   iName = RS.fields(1)

Else

   iName = "Try Again"

End If

 

    'Return the field value

    iName = "" & RS.fields(Name).Value

 

    'Close the recordset

    RS.Close

GetNextRecord = iName

End Function

 

Public Sub OpenDB(dbName As String)

'Open the database

Set db = OpenDatabase(dbName)

End Sub

 

 

Home ] Up ]

Send mail to wmecproject@lycos.com with questions or comments about this web site.
Last modified: July 13, 2002