Works great Lyle :) Thanks
"Lyle Fairfield" <MissingAddress@Invalid.Com> schreef in bericht
news:Xns94A49134B2774FFDBA@130.133.1.4...[color=blue]
> "Ronny Sigo" <ronniesigo@skyynet.be> wrote in
> news:404a0656$0$315$ba620e4c@news.skynet.be:
>[color=green]
> > Hello all,
> > I am trying out arrays for the first time now. While running this code
> > below I get the error: "No current record" (or at least something like
> > that, cause I have the dutch version)
> > Can anybody tell me what I am doing wrong ? I have put "PROBLEM LINE"
> > after the line that causes the error ....
> >
> > Dim I As Variant
> > Dim StrVal As Variant
> >
> > Dim aStatus(288) As Integer
> >
> > Dim nTeller As Integer
> > nTeller = 0
> > Do While nTeller < 288
> > aStatus(nTeller) = nTeller
> > nTeller = nTeller + 1
> > Loop
> > '*****************************************
> > Dim dbase As DAO.Database
> > Dim rstDocs As DAO.Recordset
> > Dim strSQL2 As String
> > strSQL2 = "SELECT * FROM tblDocnames_NL_EN"
> > Set dbase = CurrentDb
> > Set rstDocs = dbase.OpenRecordset(strSQL2)
> > rstDocs.MoveFirst
> > Dim aDocs(288) 'As String
> > For Each StrVal In aDocs
> > aDocs(StrVal) = Nz(Trim(rstDocs!Docname)) 'PROBLEM LINE
> > Debug.Print aDocs(StrVal)
> > rstDocs.MoveNext
> > Next StrVal
> > '*****************************************
> > Dim dbs As DAO.Database
> > Dim rst As DAO.Recordset
> > Dim strSQL As String
> > Dim nHoeveelMails As Long
> > nHoeveelMails = 0
> > strSQL = "SELECT * FROM tblDhscmails where [enable] = True"
> > Set dbs = CurrentDb
> > Set rst = dbs.OpenRecordset(strSQL)
> > rst.MoveFirst[/color]
>
> Your DOA coding is very inefficient. Why waste time on it? ADO is much[/color]
more[color=blue]
> powerful and simple:
>
> Dim a() As String
> Dim r As ADODB.Recordset
> Set r = CurrentProject.Connection.Execute("SELECT DISTINCT
> fldDescription " _
> & "FROM tbl2002Transactions " _
> & "WHERE fldDescription IS NOT NULL " _
> & "ORDER BY fldDescription;")
> a = Split(r.GetString(, , , ","), ",")
>
> and that's it ...
>
> --
> Lyle
> (for e-mail refer to
http://ffdba.com/contacts.htm)[/color]