Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this.
Go Back  Xtreme Visual Basic Talk > > > Error on Next no For (What gives?) ... I am new at this.


Reply
 
Thread Tools Display Modes
  #1  
Old 09-26-2008, 12:52 PM
tyflkasjdi tyflkasjdi is offline
Newcomer
 
Join Date: Sep 2008
Posts: 2
Angry Error on Next no For (What gives?) ... I am new at this.


Ok this is killing me. I need some fresh eyes. I am new at this so please no flamming but all suggsetions on making this more efficient is welcome.

I am getting an error saying that I don't have for For, for my Next statment. It looks like it doesn't even finnish the initial compile. What is going on?

Code:
Sub ImportInfo()

'Declare Connection and Record Sets
Dim CurConn As New ADODB.Connection
Dim myDbase As Database
Dim tbl_Info As New ADODB.Recordset
Dim tbl_SCV_Codes As New ADODB.Recordset


'Open Database
Set myDbase = CurrentDb

'Open connection
CurConn.Provider = "Microsoft.Jet.OLEDB.4.0; data source = " & myDbase.Name
CurConn.Open

'Open Tables
tbl_Info.CursorType = adOpenDynamic
tbl_Info.LockType = adLockOptimistic
tbl_Info.Open "SELECT SVC, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45, f46 FROM tbl_Info", CurConn
tbl_SCV_Codes.Open "SELECT str_SCV_Code, strProduct FROM tbl_SCV_Codes", CurConn


'Declar Var & Const
Dim sTempSVC As String
    sTempSVC = ""
Dim sTempProd As String
    sTempProd = ""
Dim x As Integer
    x = 1
Dim sTempFieldName As String
    sTempFieldName = ""
ReDim arrRcd(1 To 47) As String
   
   
'Read Records into array Loop
Do While Not tbl_Info.EOF
    sTempFieldName = "tbl_Info!f" & x
    sTempSVC = arrRcd(x)
        For x = 1 To 47
            sTempProd = arrRcd(1 + x)
            MsgBox sTempSVC & " " & sTempProd
            If sTempProd = "" Then Next x Else GoTo LineA
                
LineA:        tbl_SCV_Codes.AddNew
                tbl_SCV_Codes!str_SCV_Code = sTempSVC
                tbl_SCV_Codes!strProduct = sTempProd
                Next x
            
tbl_Info.MoveNext
tbl_SCV_Codes.Update
    
'Close connections, etc
     Set tbl_SCV_Codes = Nothing
     Set tbl_Info = Nothing
     Set myDbase = Nothing
     Set CurConn = Nothing


End Sub
Reply With Quote
  #2  
Old 09-26-2008, 01:05 PM
tyflkasjdi tyflkasjdi is offline
Newcomer
 
Join Date: Sep 2008
Posts: 2
Default

Ok I will come back to this. I found a couple problems please disregard.
Reply With Quote
  #3  
Old 09-26-2008, 04:17 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline
Out Of Office

Retired Moderator
* Expert *
 
Join Date: Mar 2005
Location: London, UK
Posts: 3,402
Default

Welcome to the forum, tyflkasjdi!

Nobody is going to 'flame' you! We have a lot of new starters here (and we were all new at this at some point), so you have nothing to worry about provided you post with the posting guidelines and how to participate here effectively threads in mind.

If you're still stuck once you've worked on the problems you've identified then post back with an updated version of your code and full details.
Please can you also confirm which version of VB you are using?

It's also really helpful to people reading the post if you use linebreaks in your code to prevent scrolling.

HTH,
Colin
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this. Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this.
 
Error on Next no For (What gives?)  ... I am new at this.
Error on Next no For (What gives?)  ... I am new at this.
 
-->