Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Access Q and A _ Calculate Distance

Posted by: payfast8898 Dec 7 2017, 05:36 PM

have an issue with this calculating distance mdb. it works fine calculating distance and time and line by line directions but it seems not to clear the cache or something because on the line by line directions it keeps adding the previous request after the first one. when I go into the database for the first time it works great. if I close the form it doesn't refresh it just closing the whole mdb and going back in.
if someone could look at it and help me out would be great thank you.


 

 CalculateDistance2000.zip ( 57.5K ): 5
 

Posted by: theDBguy Dec 7 2017, 05:41 PM

Hi,

Have you tried adding something like this as the first code for your Calculate button?

Me.txtDirection = Null

Hope it helps...

Posted by: payfast8898 Dec 7 2017, 06:00 PM

yes I have tried that. as I said I can close the form clear the form but nothing seems to fix it accept going out and coming back in.

Posted by: theDBguy Dec 7 2017, 06:08 PM

Oh, I see. Try using this instead:

strInstructions = ""


Scratch that. In your module, comment out all the public variables.

CODE
Option Compare Database
Const strunits = "imperial" ' imperial/metric (miles/km)
'Const strunits = "metric"

'Dim strTravelTime As String
'Dim strDistance As String
'Dim strInstructions As String
'Dim strError As String

Function getUnit()
    getUnit = strunits
End Function


Hope it helps...

Posted by: payfast8898 Dec 7 2017, 09:22 PM

Awesome Awesome thank you it seems to be working great!

Posted by: theDBguy Dec 7 2017, 09:35 PM

Hi,

Glad to hear it worked for you. Good luck with your project.