I need help to get the value from a Json string using VBA MS Access, I'm able to get the first two line correct but failed on the last two lines , the problem is how to move into the collection
Here the raw Json data where I want to grab the last two pieces of information:
Code:
Private Sub Cmdgetweather_Click()
Dim Json As Object
Set Json = JsonConverter.ParseJson(GetWeather)
'i = 1
On Error Resume Next
'Process data.
Me.txtlongitude = Json("coord")("lon")
Me.txtlatitude = Json("coord")("lat")
Me.txtmain = Json("coord")("weather")("main")
Me.txtdescription = Json("coord")("weather")("description")
Set Json = Nothing
End Sub
Here the raw Json data where I want to grab the last two pieces of information:
Code:
{"coord":{"lon":28,"lat":-15},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"base":"stations","main":{"temp":299.87,"feels_like":299.81,"temp_min":299.87,"temp_max":299.87,"pressure":1009,"humidity":40,"sea_level":1009,"grnd_level":887},"visibility":10000,"wind":{"speed":2.36,"deg":113,"gust":9.52},"clouds":{"all":95},"dt":1734888973,"sys":{"country":"ZM","sunrise":1734838572,"sunset":1734885427},"timezone":7200,"id":904264,"name":"Mungule Court","cod":200}