473,322 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

for each statement list compare

I have two listbox arrays 1 dimensional.

They have the same items but in a different order.

Depending on the order of the second newer listbox I'm constructing a
querystring
to sort the order of returned values, select field3, field1, field2, field4
from etc..

What's an easier more logical way to do this which works for 2 values in the
listbox?

If templist.Items.Count = appfields.Items.Count Then

newfieldcount = 0
newfieldorder = 0

Do Until newfieldcount = appfields.Items.Count - 1

If Trim(templist.Items(newfieldorder)) =
Trim(appfields.Items(newfieldcount)) Then
If newfieldorder <> appfields.Items.Count Then
fieldstr = fieldstr & "field" &
CStr(newfieldorder + 1) & ", "
End If
newfieldcount = newfieldcount + 1
newfieldorder = 0
End If
newfieldorder = newfieldorder + 1
Loop

fieldstr = fieldstr & "field" & CStr(newfieldorder) & ","
appfields.Items.Clear()
appfields.Items.AddRange(templist.Items)
End If
Nov 23 '05 #1
0 803

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Glenn Robinson | last post by:
Hello, I have two tables I'm working on: In tableA each row consists of an object, its required status and its current status e.g. Object Req Status Cur Status ...
2
by: gssstuff | last post by:
I have a piece of code I use to compare two identically structured tables. There are 15+ sets of tables I am comparing. I am looking to see what has changed between the "old" and "new" versions...
1
by: Booser | last post by:
// Merge sort using circular linked list // By Jason Hall <booser108@yahoo.com> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <math.h> //#define debug
24
by: Robin Cole | last post by:
I'd like a code review if anyone has the time. The code implements a basic skip list library for generic use. I use the following header for debug macros: /* public.h - Public declarations and...
11
by: Neo | last post by:
Hi Frns, Could U plz. suggest me how can i reverse a link list (without recursion)??? here is my code (incomplete): #include<stdio.h>
4
by: MJ | last post by:
Hi I have written a prog for reversing a linked list I have used globle pointer Can any one tell me how I can modify this prog so that I dont have to use extra pointer Head1. When I reverse a LL...
2
by: kevinjbowman | last post by:
I have the following query I wrote in MySQL 5.0 Select eq_employees.empid, eq_sigreturns.returnid From eq_employees Left Join eq_sigreturns ON eq_employees.empid = eq_sigreturns.empid
2
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a generic list populated by a structure and sorts the contents of the list based on the day and project # that is part of the structure. I would like to modify it to also sort on the...
36
by: pereges | last post by:
Hi, I am wondering which of the two data structures (link list or array) would be better in my situation. I have to create a list of rays for my ray tracing program. the data structure of ray...
4
by: MisterE | last post by:
// Is any of this not portable correct etc? #include <stdlib.h> typedef struct b { int f; } B; //Should pointers to pointers be avoided or nothing wrong with this: int compare( const void...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.