RS. to Variables

Results 1 to 2 of 2

Thread: RS. to Variables

  1. #1
    Join Date
    Dec 1969

    Default RS. to Variables

    I am pulling several fields out of a Db with an SQL string... Each beocomes part of a record set. RS.ExampleA, RS.ExampleB, etc.<BR><BR>For one of these fields, I am making the value a variable, in order to perform some sting manipulations. <BR><BR>Dim ExampleA<BR>RS.Fields("ExampleA") = ExampleA<BR>ExampleAleft = Left(ExampleA, 4) &#039;sting manipulations<BR><BR>The problem I run into, is that there may be 100 records, and each record has a unique value for RS.Fields("ExampleA"), setting it to a variable causes each record to display the value of the first record, I assume this is because the variable value doesn&#039;t change, like the RS.Fields("") does with each new listed record.<BR><BR>So, the question is, how can I perform the sting manipulations on the unique RS.Fields("ExampleA") for each record without making it a static variable? <BR><BR>Or, is there a better approach?<BR><BR>Any insight?

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default Simple

    set the variable to the recordset value INSIDE the loop<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts