Solved

Variable uses and automation type not supported in visual basic

Posted on 2015-02-12
8
73 Views
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?
0
Comment
Question by:Bob Schneider
  • 5
  • 3
8 Comments
 
LVL 46

Expert Comment

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

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()
    Else
        ReDim RawReads(4, 0)
    End If
    rs.Close
    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

0
 
LVL 46

Accepted Solution

by:
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?
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 46

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?
0
 

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.
0
 
LVL 46

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.
0
 
LVL 46

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
0
 

Author Comment

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

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

776 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