Results 1 to 2 of 2

How to add a collection to a dictionary in Ms Access VBA/Json

  1. #1
    nector is offline Novice
    Windows 8 Access 2016
    Join Date
    Sep 2019
    Posts
    3

    How to add a collection to a dictionary in Ms Access VBA/Json


    Hi Experts!

    After working so hard to make sure this VBA/Json works now I seam to be very close to sorting it out, the code below works okay but I just need to know how to add a collection to the current dictionary so that the arrays also shows up:

    Code:
    Option Compare Database
    Option Explicit
    Private Sub Command0_Click()
    Dim foo As New Dictionary
    Set foo = New Dictionary
    Dim hoo As New Collection
    
        With foo
            .Add "Customer Name", Me.txtchris   'No key. This item can only be retrieved by index.
            .Add "Address", Me.txtAddress  'Key given. Can be retrieved by key or index.
    
        End With
    
        Dim member As Variant
        For Each member In foo
    
        Next
    MsgBox JsonConverter.ConvertToJson(foo, Whitespace:=3), vbOKOnly, "Audited by Chris Hankwembo"
    End Sub


    Requirements

    (1) How to add the collection to "FOO" dictionary so that the data in "HOO" collection comes in as a second layer and inclosed like [{ ]}

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    14,305
    nector,

    This is not an answer to your question. It is a link to related JSON/Access manipulation. Isladogs/Colin has analyzed, designed and created a routine which he offers for a fee. The related threads may provide some ideas to assist you in your project.
    Good luck.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 09-22-2019, 11:54 AM
  2. Replies: 11
    Last Post: 02-02-2019, 11:54 PM
  3. Replies: 3
    Last Post: 12-26-2016, 03:28 PM
  4. Replies: 5
    Last Post: 08-30-2016, 06:53 AM
  5. System DSN (MS Access) to REST API / JSON
    By Hitesh in forum Queries
    Replies: 1
    Last Post: 03-15-2016, 11:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums