Count commas and use as array size

Duhuhude

New member
Local time
Today, 13:54
Joined
Apr 7, 2011
Messages
2
Hello everyone

I need to use VBA to retrieve a record from a query, count the number of commas, and use that number +1 as the size of an array. How do I go about doing this?

Thanks
 
I would use something like

Code:
myInteger = ubound(split("This,is,my,test,string,",","))+1
 
Thanks, but before I try that, how do I retrieve a record from a query?
 
Thanks, but before I try that, how do I retrieve a record from a query?

You would use a recordset object most likely.
Code:
Dim rs as DAO.Recordset
 
set rs = CurrentDB.OpenRecordset("QueryName")
 
'Work with recordset here
 
i think the understanding was that you knew how to work with queries, and were needing help with analysing the data.

thinking again, though, if you have a query - why would you have any embedded commas within the query records? A query normally consists of a number rows, each one consisting of a number of independently addressable named fields.
 

Users who are viewing this thread

Back
Top Bottom