Invalid Outside Procedure

  • Thread starter Thread starter beliado
  • Start date Start date
B

beliado

Guest
I'm trying to run a purchased app via a form load (or any event, for that matter) in Access. Instructions were to register the dll and then create a class module with the code shown below. I've done that, and I get "Invalid Outside Procedure" when the form attempts to load. Any help is greatly appreciated.

Dim calc As DistanceAssistant
Set calc = New DistanceAssistant

'It may be necessary to use this form:
'Dim calc : Set calc = CreateObject("ZIPCodeDownload.DistanceAssistant")

Dim distance As Double
distance = calc.Distance(dblLat1,dblLong1,dblLat2,dblLong2)
 
Never Mind...

...I got it. In case anyone is interested, this calculates the distance between to zip codes housed in the same table using latitude and longitude.

I created a subroutine called get distance. It pulls values from the loaded form and then returns the distance to a text box in the same form.

Dim calc: Set calc = CreateObject("ZIPCodeDownload.DistanceAssistant")
' the purchased app.

Dim distance As Double

distance = calc.distance([Forms]![FRM_DISTANCE]![QRY_START_ZIP.Latitude], [Forms]![FRM_DISTANCE]![QRY_START_ZIP.Longitude], [Forms]![FRM_DISTANCE]![QRY_END_ZIP.Latitude], [Forms]![FRM_DISTANCE]![QRY_END_ZIP.Longitude])
[Forms]![FRM_DISTANCE]![TXT_MILEAGE].SetFocus
[Forms]![FRM_DISTANCE]![TXT_MILEAGE].Value = distance

Then just call this subroutine from any event, in my case the refresh button and the form load event.
 
I don't see what you got ! What caused the 'Invalid Outside Procedure' error ?
 

Users who are viewing this thread

Back
Top Bottom