Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Two Dimensional Array "Brain Freeze"

Posted on 2002-04-16
3
Medium Priority
?
254 Views
Last Modified: 2010-05-02
VB EE,
I am new to VB and I need to make a two dimensional array that will have a search feature (Do until Boolean found). I am having trouble with the initial layout.

I have three Brands with product numbers. I have a fourth brand that the numbers correspond to.

I need to be able to select one of the three brands (list box?) and then input a product number (text box). The label caption will then display the corresponding result from the fourth brand.

I just need a hand getting started as my brain is locking up when I try to get this going.

I have started with:

mstrParts(0 To 8, 0 To 3) As String (It needs to be string as the product numbers are alphanumeric)


formload
mstrParts(0, 0) = "A12"
mstrParts(1, 0) = "C41"
mstrParts(2, 0) = "D22"
etc..

After I have all arrays defined, I can't seem to figure out how to get the ball rolling.

Any help would be appreciated.
Thanks.
dresdena1

0
Comment
Question by:dresdena1
3 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 400 total points
ID: 6945738
I don't really understand your data.

You select the brand then enter a part number.  Do you want to search the entire array for the part number or only one column?

Does your data look like this?

Brand1     Brand2     Brand3   Brand4
A123       B123       C123     D123
A234       B345       C124     D321
.
.
.

If so then you need to use a list box or radio buttons to select the brand.  The brand then must be translated into a column number (0-2)

row=0
notfound = FALSE
while (row < numberofrows AND PartNotFound)
  if (mstrparts(row, col) = EnteredPartNumber) then
     PartisFound
  else
     Increment row
  endif
wend

if PartIsFound then
  Display mstrparts(row,3)
else
  display "Not such part"
endif

Code is rough but this sounds like a homework problem.  The above algorithm should work.

Try to implement it.  If you have further questions feel free to post the code you have and then ask for more help.

mlmcc
0
 
LVL 5

Expert Comment

by:Chandramouli k
ID: 6945747
I dont understand what u exactly want from us?
0
 

Author Comment

by:dresdena1
ID: 6945773
Homework assignment it is.
I am not looking exactly for the answer. Just a little help getting started. That is why I was somewhat vague.

I am trying to learn this, not just complete an assignment.
I think that I will be able to get through this, based on what you have shown me.

I am not going to post more code, because if I can't get it right, I will get help in class.

Thanks for your help.
dresdena1
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month21 days, 7 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question