Variable uses and automation type not supported in visual basic

Posted on 2015-02-12
Last Modified: 2015-02-16
I am trying to write records to a vb list box and one field is of the "time" variable type.  I get the error message indicated in the post title even when I try to write it as CStr(value).  Any ideas?
Question by:Bob Schneider
  • 5
  • 3
LVL 45

Expert Comment

by:Martin Liss
ID: 40607043
Can you post your workbook?

Author Comment

by:Bob Schneider
ID: 40607080
Here is my code:
    Set rs = New ADODB.Recordset
    sql = "SELECT Bib, Chip, Time, Reader, Antenna FROM RawRFID WHERE EventID = " & lEventID
    rs.Open sql, conn, 1, 2
    If rs.RecordCount > 0 Then
        RawReads = rs.GetRows()
        ReDim RawReads(4, 0)
    End If
    Set rs = Nothing
    For i = 0 To UBound(RawReads, 2)
        lstRawData.AddItem i + 1 & vbTab & RawReads(0, i) & vbTab & RawReads(1, i) & vbTab & RawReads(2, i) & vbTab & RawReads(3, i) & vbTab & RawReads(4, i)
    Next i

Open in new window

LVL 45

Accepted Solution

Martin Liss earned 500 total points
ID: 40607108
Does it work if you don't try to add that field?

Why are you using a listbox with "coulmms" created with tabs rather than a listview or some type of grid?
LVL 45

Assisted Solution

by:Martin Liss
Martin Liss earned 500 total points
ID: 40607121
In Access could you convert the problem field to some other type before you try to add the data to the listbox?
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.


Author Comment

by:Bob Schneider
ID: 40607828
The problem is that, as I write it to the array, I can't transfer it to the list box even if I convert it to a string.  I think I will just change the data type.  I don't think it needs to be Time necessarily.  I will leave this open in the event someone has a better solution.
LVL 45

Expert Comment

by:Martin Liss
ID: 40608034
I think I will just change the data type.
That's what I was suggesting in my previous post.
LVL 45

Expert Comment

by:Martin Liss
ID: 40612211
I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014

Author Comment

by:Bob Schneider
ID: 40612256
I will look at that.  Thanks so much!!!

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now