[AccessD] Which Is Faster - DAO or db.Execute?

Gustav Brock Gustav at cactus.dk
Wed Oct 29 12:30:23 CDT 2008


Hi Rocky and Jim

Yes, but don't forget to put the loop of Rocky's updates _inside_ that function.

/gustav


>>> jim at therareshop.com 29-10-2008 18:13:28 >>>
yup, like this-

Function FindPeriod()
Dim dbs As Database
Dim rstbase As Recordset
Dim strTable As String

strTable = "tblPeriods"
Set dbs = WhichDB(strTable)
Set rstbase = dbs.OpenRecordset(strTable, dbOpenTable)
'find record with current period
rstbase.Index = "fldStatus"
rstbase.Seek "=", "B"
intPeriodNo = rstbase.Fields("fldPeriodno")
intMonth = rstbase.Fields("fldMonth")
intyear = rstbase.Fields("fld year")
 rstbase.Close
 Set rstbase = Nothing
End Function

So you pas the name of any table in the target db and then use the standard
db.OpenRecordset on the table you want to 'Seek'?






More information about the AccessD mailing list