Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using arrays to get field values

Status
Not open for further replies.

tksayy

Programmer
Nov 3, 2008
17
0
0
DE
I am trying to use the following syntax to get all the values in a column for a particular field in to an array

(astrFields(intIx)) points to the field name


varii = (.Fields(astrFields(intIx)))

if varii is declared as variant is this enough to get all the field values into varii
 
varii will grab the value of the field in the current record.
Have a look at the GetRows method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
but wont getrows get all the fields of recordset
 
wont getrows get all the fields of recordset
Yes with DAO
You may choose the field(s) with ADODB

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Actually i am already using that recordset for another loop with dao.
now should i make another connncetion to the databse using ado.
if i do this this will come in the loop by dao

is this ok

hope i am clear
 
I'd don't mix DAO and ADODB in the same procedure for the same data.
 
suppose i have populated an array caleed vari_able

i want to check if the value 888 exists in the array

will this work
If vari_able <> 888 then
 
Why not simply use the FindFirst method of the DAO.Recordset object ?
Why populating array(s) when you already have the data in the recordset ?
What do you want to do ?
Why posting in the JetSQL forum when obviously you have VBA problems ?
 
sorry about the posting i though recordsets would come under jet sql

i have an array validcodes with a few values.

i have a recordset with two column id number and field values

i want to check the values of array validcodes with the field values of recordset and if they dont match i want to dispaly the id number of the non matching field

hope iam clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top