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
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