Access 2007 VBA recordset

Crilen007

Uhm, Title... *shrug*
Local time
Yesterday, 22:00
Joined
Jun 13, 2003
Messages
531
Whats the new proper way to do recordsets in VBA for Access 2007?


Any examples would be great, thanks.
 
Same way as in previous versions, why do you ask? You can use DAO or ADO (for ACCDB files, DAO is the default).
 
Hmm...


There a way to select a record set using an SQL statement instead of the query name?
 
Yep, you can set the recordset in the On Load event:

Me.Recordset = "SELECT whatever FROM whateverTable WHERE WhateverField = WhateverValue"

etc.
 
Well...


What I'm trying to do is calculate the time difference between records in a table using VBA and cycling records.

So I was hoping to select the records using SQL so I can choose what day and person it should be etc... It's been a while since I've had to use access lol, I would normally use PHP to do something like this.
 
Well I guess I can use SQL instead of the Query Name, I love VBA sometimes lol
 
I thought you wanted a SQL Statement instead of the query name. You can also use

Me.Recordsource = "NameOfSavedQuery"

that will work too.
 

Users who are viewing this thread

Back
Top Bottom