Trim() from "DOS" screen

rrueger

Registered User.
Local time
Today, 00:06
Joined
May 19, 2011
Messages
10
Hello,
there is a form at work which basically has a command button on it, when clicked is able to get data from what we call a session screen (basically like a dos screen with customer info) as long as its open, and places the info in the txt box.

I have been asked to make another form, simpler, but I can't get it to work. Any help or direction would be greatly appreciated.

Here is the Module:

Option Compare Database

Function GetSession()
Dim Connlist As Object

Set Session = CreateObject("pcomm.auteclps")
Set auteclconnlist = CreateObject("pcomm.auteclconnlist")
Set autecloia = CreateObject("pcomm.autecloia")
Set auteclps = CreateObject("pcomm.auteclps")
auteclconnlist.Refresh
'=============
Set Connlist = CreateObject("PCOMM.autECLConnList")
Connlist.Refresh
Ready = Connlist.Count
If Ready = 0 Then
MsgBox "There is a problem connecting to the session.", vbExclamation, "Session"
GoTo Exit_GetSession
End If
'===========
Session.SetConnectionByName (auteclconnlist(1).Name)
autecloia.SetConnectionByName (auteclconnlist(1).Name)
auteclps.SetConnectionByName (auteclconnlist(1).Name)

Session.SendKeys ("[home]")
autecloia.WaitForInputReady (10000)
Exit_GetSession:
Exit Function
Err_GetSession:
MsgBox "There is a problem connecting to the session.", vbExclamation, "Session"
MsgBox "Confirm session 'a' in bottom left corner is visible", vbExclamation, "Session"

MsgBox "Error Number " & Err.Number & " " & Err.Description
Resume Exit_GetSession
''''''''''''''''''
End Function



Here is the Form Code:

Private Sub CmdGetData_Click()
Dim db As DAO.Database
Dim rst1 As DAO.Recordset
Set db = DBEngine.Workspaces(0).OpenDatabase("path")
Set rst1 = db.OpenRecordset("tblRCM")
Call GetSession

Me.txtName = Trim(Session.GetText(4, 2, 50))

End Sub




I'm getting a missing object error when I click the button.
Im really not sure how to write this, or make work
 
Not familiar with this exact stuff but it may be a problem with the scope of the object variables.

Variables required in multiple procedures need to be Dimmed in the declarations section at the top of the module.
 

Users who are viewing this thread

Back
Top Bottom