I'm trying to open a recordset and insert all the values from a specified table. I then want to be able to read each record one by one so I can manipulate some SQL code depening on the field values.
Dim Rs1 As New ADODB.Recordset
Dim SQLCode, StrData(5) As String
Dim cnn As ADODB.Connection
Dim Response, IntX, IntN As Integer
Set Rs1 = New ADODB.Recordset
Set cnn = CurrentProject.Connection
SQLCode = "SELECT * FROM TblModels"
Rs1.Open SQLCode, cnn
'StrData(1) = Rs1.Fld_ModelNo
'StrData(2) = Rs1.Fld_Manufacturer
'StrData(3) = Rs1.Fld_ModelType
'StrData(4) = Rs1.Fld_RetailPrice
'StrData(5) = Rs1.Fld_QtyAvailiable
I know the above code doesn't work - but how do I asign the field values to the StrData array one record at a time an loop through the whole table / recordset ??
Steady ...![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
Dim Rs1 As New ADODB.Recordset
Dim SQLCode, StrData(5) As String
Dim cnn As ADODB.Connection
Dim Response, IntX, IntN As Integer
Set Rs1 = New ADODB.Recordset
Set cnn = CurrentProject.Connection
SQLCode = "SELECT * FROM TblModels"
Rs1.Open SQLCode, cnn
'StrData(1) = Rs1.Fld_ModelNo
'StrData(2) = Rs1.Fld_Manufacturer
'StrData(3) = Rs1.Fld_ModelType
'StrData(4) = Rs1.Fld_RetailPrice
'StrData(5) = Rs1.Fld_QtyAvailiable
I know the above code doesn't work - but how do I asign the field values to the StrData array one record at a time an loop through the whole table / recordset ??
Steady ...
![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)