473,491 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Appending an Incremental Variable to a String in a Loop

1 New Member
Hope this finds everyone well. Happy New Year!

I'm trying to build a Loop for a set of dropdown menus I'm inserting into a form.

Basically, the client has to be able to select 1 to 20 donors with the dropdown options (member names) pulled from the DB. When the client is editing a donation record, she needs to be able to view the correct donors for a specific donation record selected in the dropdowns. This means matching the Donor IDs in the Donations Table with the Member IDs in the Members table, and then pulling the member's name to display in the dropdown.

Unless I can find a way to loop, I've got to have 20 of these in my code

Below is what the non-incremental, non-loop dropdown looks like:

<div id="donor_1" style="display:inline">

<select name="Donor_ID_1">
<option value="">-- Select the Donor --</option>
<% DO UNTIL MembersInfo.EOF %>
<% strMembersID1 = MembersInfo.Fields("ID") %>
<% intComparison1 = strComp(strMembersID1, strRecord_ID_1) %>
<option <% IF intComparison1 = 0 THEN %>selected<% END IF %> value="<%=MembersInfo.Fields("ID")%>"><%=MembersIn fo.Fields("L_Name")% >, <%=MembersInfo.Fields("F_Name")%>&nbsp;<% IF MembersInfo.Fields("M_Init") <> "" THEN%><%=MembersInfo.Fields("M_Init")%><% END IF %> (User ID: <%=MembersInfo.Fields("ID")%>)</option>
<% MembersInfo.MOVENEXT %>
<% LOOP %>
<% MembersInfo.MOVEFIRST %>
</select> &nbsp;<input type="button" value="+" name="add_donor_1" onClick="toggleBox('donor_2',1);" title="Add an Additional Donor"><br>

</div>

Here's my attempt at a loop...but it's not working:

<%
x = 1
DO WHILE x < 21
%>
<div id="donor_<%=x%>" style="display:inline">

<select name="Donor_ID_<%=x%>">
<option value="">-- Select the Donor --</option>
<% DO UNTIL MembersInfo.EOF %>
<% strMembersID+"&x&" = MembersInfo.Fields("ID") %>
<% intComparison+x = strComp(strMembersID+x, strRecord_ID_+x) %>
<option <% IF intComparison+x = 0 THEN %>selected<% END IF %> value="<%=MembersInfo.Fields("ID")%>"><%=MembersIn fo.Fields("L_Name")% >, <%=MembersInfo.Fields("F_Name")%>&nbsp;<% IF MembersInfo.Fields("M_Init") <> "" THEN%><%=MembersInfo.Fields("M_Init")%><% END IF %> (User ID: <%=MembersInfo.Fields("ID")%>)</option>
<% MembersInfo.MOVENEXT %>
<% LOOP %>
<% MembersInfo.MOVEFIRST %>
</select> &nbsp;<input type="button" value="+" name="add_donor_<%=x%>" onClick="toggleBox('donor_<%=x+1%>',1);" title="Add an Additional Donor"><br>

</div>
<% x = x+1 %>
<% LOOP %>

Any and all help would be greatly appreciated. I feel like I'm just blowing the syntax on appending the incremental integer to the other strings.

Many thanks in advance! Noah
Jan 2 '09 #1
0 2614

Sign in to post your reply or Sign up for a free account.

Similar topics

5
1781
by: Bangalore | last post by:
Hi In reversing string usring recursive function, i found problems in using incremental postfix , and incremental prefix 1 void rev(char*); 2 void main() 3 { 4 char s="STRING"; 5 ...
2
1600
by: Robizzle | last post by:
I am having problems appending a number to the end of a string. I searched google and google forums and couldn't figure it out .... sorry i'm sure its simple. so I have: $filename =...
16
12578
by: Michael | last post by:
I have a data application in a2k that I need to create two fixed width text files and then combine them to a single file The first file is header information and the second is transaction data. ...
0
3116
by: Willem | last post by:
Based on MK's TSI_SOON (http://www.trigeminal.com/)I've created a nifty little procedure that - whenever you compact you db you get an incremental backup copy. Given that you have a table with...
4
2433
by: Luis Ferrao | last post by:
Comming from Windows Forms development, I never had problems with this issue before. What i'm trying to achieve is an iTunes like incremental search. For those who never used iTunes, it's...
6
3656
by: Raj | last post by:
How can we do an online restore of a tablespace using the incremental backup's? we are on a partitioned database... Also, how could we use backup copy made by the load (using the copy to option...
6
14145
by: Jody Gelowitz | last post by:
I have run into an issue with variable scope within an XSLT document that is translated in VS.NET 2.0. Under VS.NET 1.1 (XslTransform), this code works fine. However, when using VS.NET 2.0...
1
1537
by: libsfan01 | last post by:
hello again! another problem im having is appending a value to a string. how come this function isnt working for me? string overwrites the value of content not gets added onto the end of it?! ...
5
3086
by: flavourofbru | last post by:
Hi, Is it possible to add an int or a string or a char to a vector variable?? For example if I declare a vector variable as follows: vector<string> abc; Can I append an integer value or some...
0
7183
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.