Hello,

I am stuck in trying to figure out how to add values to the parameters while looping. The code below is hard-coded to add the value of the array to the parameter which works fine if there is only 1 line to import but I know for a fact that the files will be more than 1 line long. Please help!

Code:
    If varType = "LogCurve" Then
                    For i = 0 To (UBound(results.ToArray())) / 3
                       
                        If chkApi.Checked = True Then
                            varApi = splitout2(x + (nbxApi.Value - 1))
                           Else
                            varApi = txtApi.Text
                            
                        End If
                        
                        If nbxDepth.Value = 0D Then
                            varDepth = 0
                        Else
                            If results(x + (nbxDepth.Value - 1)) = "" Then
                                varDepth = 0
                            Else
                                varDepth = results(0)

                            End If
                        
                          
                            If nbxSPC.Value = 0D Then
                                varSPC = 0
                            Else
                                If results(x + (nbxSPC.Value - 1)) = "" Then
                                    varSPC = 0
                                Else

                                    varSPC = results(1)
                                End If
                            End If
                            

                            If nbxVSH.Value = 0D Then
                                varVSH = 0
                            Else
                                If results(x + (nbxVSH.Value - 1)) = "" Then
                                    varVSH = 0
                                Else
                                    varVSH = results(2)
                                End If
                            End If
                         
                            Me.InsertDB()
                           
                            varCount = varCount + 1
                        End If

                    Next