I'm just finishing up my project for school but I've seem to have hit a speed bump. Here's the code I'm working on :

Private Sub Command1_Click()
cnt = 0
search = Val(Text1(1).Text)

For cnt = 0 To 7
    If search = memberarray(cnt, 0) Then
     memberLbl = "Member ID:" & memberarray(cnt, 0) & vbNewLine & "Member Name:" & memberarray(cnt, 1) & vbNewLine & "Member Date of Birth" & memberarray(cnt, 2) & vbNewLine & "Member Address" & memberarray(cnt, 3) & vbNewLine & "Member Phone Number" & memberarray(cnt, 4)
    End If
Next cnt


End Sub

So, to explain a bit, what I've been doing is, loading up all the information from a file onto an array then reading this array into a label based on a search. Now what I've been using is a counter from 0 to 7 but this will disable me from being able to add a new member to the list, which I really need to be able to do.

Can anyone please help me with this?
Thanks.

Recommended Answers

All 2 Replies

If anyone has anything to ask about this piece of code or anything to contribute please post, I've been at this for ages now but still haven't been able to work out a solution.

Well if you are using a dynamic array, you can always check the UBound for looping and then use redim preserve for reallocating/redimensioning your array to hold more information...

Good Luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.