Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

What is wrong with my code?

  • Please log in to reply



    New Member

  • Member
  • Pip
  • 5 posts

I have written the follwoing code.

Dim clientName As String 
    Dim clientNameArray() 
    Dim count1 As Integer 
    Dim NumberOfClients As Integer 
    NumberOfClients = 0 
    ReDim clientNameArray(NumberOfClients) 
    clientNameArray(0) = "test" 
    count1 = 1 
    Dim count2 As Integer 

          clientName = RecordArray(cnt1, 0) 
                    'clientNameArray(count1) = clientName 
                    MsgBox "Test1" + clientName 
                    'IDAccFSEB = IDAccFSEB + 1 
                    'count1 = 1 
                    'count2 = 0 
                    For count2 = 0 To count1 
                    MsgBox "Test" + clientNameArray(count2) 
                    MsgBox "Test2" + clientName 
                        If Not LCase(clientNameArray(count2)) <> LCase(clientName) Then 
                            IDAccFSEB = IDAccFSEB + 1 
                            clientNameArray(count2) = clientName 
                            MsgBox "Test" + clientNameArray(count1) 
                            count1 = count1 + 1 
                        End If 
       End If 

What happens is i retrieve the clientName from an array.
I have instantiated the array with one record so as it not being empty. If the client'sName is not the same as in the array, then i should the client's name shpuld be inserted into the array and increment a counter. This counter keeps track of the number of clients. However, i keep getting zero for the following variable "IDAccFSEB". y? I hope someone can help. Its urgent. Thanx
  • 0





  • Member
  • PipPip
  • 51 posts
put Option Explicit at the top to see if you have any spelling errors and is this vb6 cause i dont understand why your if statement has If........
  • 0




  • Member
  • PipPip
  • 48 posts
NumberOfClients = 0
ReDim clientNameArray(NumberOfClients)

but later you used clientNameArray(1) ??
  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP