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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

programatically delcare variables

Status
Not open for further replies.

imarosel

Technical User
Jun 23, 2005
149
US
Maybe getting too carried away here but can I programatically declare variables that are fields in a recordset? The following code does not work.

For k = 0 To minSet.Fields.Count - 1
dim minSet.Fields(k).name
Next k
 
The real question is: what do you want to do ?
Dim is a compile time instruction ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I have recordsets with lots of columns. I want variables with the same names as the columns. I was hoping i wouldn't have to write them all out one-by-one.
 
Why not simply use an array ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I see where you are going with this. I have figured out an alternate solution. Thanks for you time though. For now I'm just going to refer to the elements in the recordset explicitly. Thanks for your quickness PHV.

 
refer to the elements in the recordset explicitly
Like this ?
minSet.Fields("name of field").Value

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top