Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using For loop values to an update query
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00774887
Message ID:
00774894
Views:
12
>Could you please help me out on this. I want to use the two column values which is in the list box into an update query until the last record from the list box.
>
>
>following is the list box values with two columns listbox name is list1.
>
>I | AT
>O | CT
>I | OP
>I | CP
>O | PC
>O | TC
>
>
>I want to use the above records values of two columns, one after the other until finished into an update query
>
>
>for 1 to cnt
> col1 = list1.column1
> col2 = list2.column2
>
>update docindex set i_o = col1 where tofrm = col2
>
>ENDfor
>
>
>Thank you very much.

This should be what you are looking for
for n = 1 to thisform.list1.listcount

   col1 = thisform.list1.listitem(n, 1)
   col2 = thisform.list1.listitem(n, 2)
   
   update docindex set i_o = col1 where tofrm = col2

endfor
Tracy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform