Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 91
  • Last Modified:

Variable uses and automation type not supported in visual basic

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
Bob Schneider
Asked:
Bob Schneider
  • 5
  • 3
2 Solutions
 
Martin LissRetired ProgrammerCommented:
Can you post your workbook?
0
 
Bob SchneiderCo-OwnerAuthor Commented:
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
 
Martin LissRetired ProgrammerCommented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Martin LissRetired ProgrammerCommented:
In Access could you convert the problem field to some other type before you try to add the data to the listbox?
0
 
Bob SchneiderCo-OwnerAuthor Commented:
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
 
Martin LissRetired ProgrammerCommented:
I think I will just change the data type.
That's what I was suggesting in my previous post.
0
 
Martin LissRetired ProgrammerCommented:
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
 
Bob SchneiderCo-OwnerAuthor Commented:
I will look at that.  Thanks so much!!!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now