blacksaibot
Registered User.
- Local time
- Today, 02:47
- Joined
- Jan 20, 2010
- Messages
- 31
Here is my VB.NET code:
This is as far as my limited VBA knowledge gets me:
First of all, why is there no "List" in VBA??? Is a collection like a hash table or something? If so, it's not what I want. I just need a simple list to house my records.
Second, is using a recordset the correct way of going about i t?
Thank you in advance!
Code:
Dim listOfRecs As List(Of Integer) = New List(Of Integer)
Dim queryStr As String = "SELECT DISTINCT recnum FROM t_User_Ldr"
con.Open()
cmd = New OleDbCommand(queryStr, con)
Using reader As OleDbDataReader = cmd.ExecuteReader()
While reader.Read()
listOfRecs.add(reader.GetValue(0))
End While
End Using
con.Close()
Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim nullDate As Boolean
Dim queryStr As String
Dim listOfRecords As Collection
queryStr = "SELECT DISTINCT rec_num FROM tbl_UserLeader_Interviewv2_0"
Set db = CurrentDb()
Set rs = db.OpenRecordset(queryStr)
With rs
If Not rs.BOF Then
.MoveFirst
Do While .EOF = False
listOfRecords.Add
.MoveNext
Loop
End If
End With
Second, is using a recordset the correct way of going about i t?
Thank you in advance!
Last edited: