Data transfer from screen outside

  • Thread starter Thread starter Ozgur
  • Start date Start date
O

Ozgur

hi,

there is screen where cursor position can be defined in coodinates.
like; (4;52)
I can transfer everything from that screen over excel.
but our excel files has also lots of formulas and worksheets and all these
are working on network and connected to other network excel files. all of
these means "very slow".
if I gather all excel files in one access, our work speed will increase
because access is database and excel is like calculator table.

is there anyone who transfer data from a different source (other than office
document format, txt, csv)? from a screen for example?

Thanx
 
If you use an Access form, then you can track the mouse move over the detail
section through the mouse move event handler:


Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Debug.Print "DetailSection", X, Y
End Sub


as example, print, in the immediate (debug) window the position of the mouse
cursor.

Rather than printing it, you can definitively save it into a table with
something like


CurrentDb.Execute "INSERT INTO tableName(x, y) VALUES(" & x & ", " &
y & ")"


instead of the debug print.


I am not sure if that is what you have in mind, though.



Vanderghast, Access MVP
 
Hello Michel,

Thank you for your quick reply. I will use them also.

I am using an interface software to get data from a host.
In excel I can define it and define variables coordinates on this interface
and copy them in excel cells.

Is it possible to convert module below to access language?

Maybe my module that I use in excel can help me explain:

Dim swap, System, Sessions, Session, Screen As Object
Dim check As Boolean
Dim typ2, sase, land, RowX, RXE As String
Dim warten As Integer

Sub Data ()

Set swap = Worksheets(“Vehiclesâ€)
Set System = CreateObject("EXTRA.System")

Set Sessions = System.Sessions

Set Session = Sessions.Open("C:\Documents and
Settings\a8990\Desktop\manhost.edp")
Set Screen = Session.Screen

If (System Is Nothing) Then
msg$ = "EXTRA! System Object can not be created!"
MsgBox msg$, 48, "Fehler"
Stop
End If

If (Sessions Is Nothing) Then
msg$ = "EXTRA! Sessions Object can not be created!"
MsgBox msg$, 48, "Fehler"
Stop
End If

If (Screen Is Nothing) Then
msg$ = "EXTRA! Screen Object can not be created!"
MsgBox msg$, 48, "Fehler"
Stop
End If

RowX = InputBox("Please enter first row to start:" & Chr$(10))
RXE = InputBox("Please enter last row to end:" & Chr$(10))

check = False

Do
Do While RowX <= RXE

typ2 = swap.Cells(RowX, 3)
typ2 = UCase(Trim(typ2))

sase = swap.Cells(RowX, 4)
sase = UCase(Trim(sase))

Screen.SendKeys ("<pf4>")
Call Warteroutine

Screen.putstring "AA76A", 2, 2
Screen.putstring Space$(1), 2, 8
Screen.putstring Space$(4), 2, 11
Screen.putstring Space$(5), 2, 16
Screen.putstring Space$(3), 2, 23
Screen.putstring Space$(4), 2, 27
Screen.putstring Space$(5), 2, 33
Screen.putstring Space$(3), 2, 40
Screen.putstring Space$(6), 2, 45
Screen.putstring Space$(8), 2, 53
Screen.putstring Space$(17), 2, 62

Screen.SendKeys ("<enter>")
Call Warteroutine

Screen.putstring typ2, 2, 23
Screen.putstring sase, 2, 27

Screen.SendKeys ("<enter>")
Call Warteroutine

'******COUNTRY*************************************
If CheckBox3 = True Then
Call Countryinfo
End If

RowX = RowX + 1
If RowX = RXE + 1 Then
check = True
Exit Do
End If
Loop
Loop Until check = True

ActiveWorkbook.Save

End Sub

Public Sub Warteroutine()
warten = 0
While Screen.oia.XStatus = 5
Screen.waithostquiet (1)
warten = warten + 1
If warten > 500 Then
MsgBox ("!!!Sistem durdu!!!")
Exit Sub
End If
Wend
End Sub

Public Sub Countryinfo()

land = Screen.Getstring(7, 67, 14)
land = Format(land, "@")
swap.Cells(RowX, 8).NumberFormat = "@"
If Left(land, 5) = " " Then
swap.Cells(RowX, 8).Value = Null
Else: swap.Cells(RowX, 8).Value = land
End If

End Sub
 
Probably, yes. But we bypass the fact that we have to write to a cell, since
we can write a whole record directly to a table:



Dim mySQLcommand AS string

mySQLcommand = "INSERT INTO tableName( FieldSomeName, FieldSomeValue1,
FiedlSomeValue2, FiedSomeValue3) VALUES( """ & SomeName & """," &
someValue1 & "," & someValue2 & "," & someValue3 & ")"

' Debug.Print mySQLcommand

CurrentDb.Execute mySQLcommand, dbFailOnError




where tableName is the table to which we append the data
FieldSomeName, FieldSomeValue1, FiedlSomeValue2, FiedSomeValue3 is
the list of fields we put data into
SomeName a variable with a name for put in FieldSomeName
someValue1 a variable with a numerical value to put in
FieldSomeValue1


You can remove the ' in

' Debug.Print mySQLcommand


to print the sql command in the immediate debug window so that you can see
what is wrong if anything goes wrong with it. In fact, you can then paste it
into the SQL view of a query in the query designer to 'run it'.



Vanderghast, Access MVP
 
Back
Top