Hello all,
I am trying to toy around with the built-in GPS chip in an HP tablet that has Access 2013 installed. I've been trying to test it out by at least first getting to see if I can get coordinates. The built-in chip uses LocationAPI.dll, and so I have loaded that on to MS Access references. After perusing through the objects list and trying to make sense of it, this is how far I've gotten:
Code:
Option Compare Database
Option Explicit
Public Function testGPS() As String
Dim Lat, Lng as Double
Dim Display as LatLongReportFactory
Set Display = New LatLongReportFactory
Lat = Display.LatLongReport.Latitude
Lng = Display.LatLongReport.Longitude
testGPS = Lat & "," & Lng
End Function
When executing the function through the Immediate window, it throws the error:
Run-time error '-2147024664 (800700e8)': Method 'LatLongReport' of object 'ILatLongReportFactory' failed.
When debugging, it highlights the line
Code:
Lat = Display.LatLongReport.Latitude
However, I don't change anything and just hit "Continue[F5]" and the function returns the proper GPS coordinates without a hitch. This is my first time trying to use Access in conjunction with things other than the typical forms, reports, etc., so my VBA knowledge is limited, but I figured this would be a great learning experience lol
Any sort of help would be greatly appreciated!