Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account

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