473,800 Members | 3,022 Online
Bytes | Software Development & Data Engineering Community
+ 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.Fie lds("ID") %>
<% intComparison1 = strComp(strMemb ersID1, strRecord_ID_1) %>
<option <% IF intComparison1 = 0 THEN %>selected<% END IF %> value="<%=Membe rsInfo.Fields(" ID")%>"><%=Memb ersInfo.Fields( "L_Name")% >, <%=MembersInfo. Fields("F_Name" )%>&nbsp;<% IF MembersInfo.Fie lds("M_Init") <> "" THEN%><%=Member sInfo.Fields("M _Init")%><% END IF %> (User ID: <%=MembersInfo. Fields("ID")%>) </option>
<% MembersInfo.MOV ENEXT %>
<% LOOP %>
<% MembersInfo.MOV EFIRST %>
</select> &nbsp;<input type="button" value="+" name="add_donor _1" onClick="toggle Box('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.Fie lds("ID") %>
<% intComparison+x = strComp(strMemb ersID+x, strRecord_ID_+x ) %>
<option <% IF intComparison+x = 0 THEN %>selected<% END IF %> value="<%=Membe rsInfo.Fields(" ID")%>"><%=Memb ersInfo.Fields( "L_Name")% >, <%=MembersInfo. Fields("F_Name" )%>&nbsp;<% IF MembersInfo.Fie lds("M_Init") <> "" THEN%><%=Member sInfo.Fields("M _Init")%><% END IF %> (User ID: <%=MembersInfo. Fields("ID")%>) </option>
<% MembersInfo.MOV ENEXT %>
<% LOOP %>
<% MembersInfo.MOV EFIRST %>
</select> &nbsp;<input type="button" value="+" name="add_donor _<%=x%>" onClick="toggle Box('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 2635

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

Similar topics

5
1800
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 rev(s);
2
1610
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 = 'test.file."; $i = 0; and I want to change $filename to become 'test.file.0'.
16
12644
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. I have tried and tried but just cant seem to get this right, I am using Queries to created my export files with specifications which works fine, I get stumped with the appending the header to my transaction file. What I have so far looks like...
0
3149
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 version information you get incremental backups on a per-version basis. SEE CODE BELOW Basic idea is: start TSISOON with the options: 1. "compact this db"
4
2443
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 basically a text field with a key stroke event that filters the data grid as the users types in a string. The more text in the field, the fewer fields desplayed. The problem is that this is obviously a client side behaviour.
6
3677
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 in load) to revover the tablespace? Thanks, Raj
6
14222
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 (XslCompiledTransform), the exact same XSLT transformation fails with the error: System.Xml.Xsl.XslLoadException: The variable or parameter 'lastrecordwaskit' was duplicated within the same scope. An error occurred at (174,12). at...
1
1566
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?! function alertchange(value) { var string = value;
5
3105
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 string value to the vector variable such that every time I call a function that has this declaration, it creates a new vector variable abc appened with the int or string value? Is there any other method by which I can do above operation
0
9694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10281
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10256
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10039
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9095
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6824
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5477
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4152
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 we have to send another system

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.