Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Within MS Access I am trying to get a list of all fields (read field objects) in a QlikView document. I assume this should be pretty straightforward by looping through the Document.Fields, but cannot get it to work.
I have tried through the Document.GetFieldDescriptions, but for some reason I cannot get a grab on the datatype returned by this function.
Has anybody ever done this?
Regards,
888 SP5
Do you need to do something with this in the script?
If you want to display them in the front end, there's a system field called $Field.
Right click on the sheet and choose "Select fields.." and then check the "Show System Fields" checkbox.
I need to get all the field objects so I can get properties for all fields.
Something like:
objCol = m_objDoc.GetFieldDescriptions
For i = 0 To m_objDoc.GetFieldCount - 1
Set oTMP = objCol.Item(i)
Debug.Print oTMP.Name
Debug.Print oTMP.GetLocked
Next
Found something that works. I wonder whether there is a cleaner approach than going through the descriptions to get actually to the field collection.
Public Sub LoadFields(objDocument As QVDocument)
Dim colFld As Object
Dim objFld As Object
Dim i As Integer
Set colFld = objDocument.GetFieldDescriptions
For i = 0 To colFld.Count - 1
Set objFld = objDocument.GetField(colFld.Item(i).Name)
m_colFld.Add objFld, CStr(objFld.Name)
Next
Set colFld = Nothing
Set objFld = Nothing
End Sub