RecordSet vs Recordsource for dynamically binding data (1 Viewer)

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:21
Joined
Feb 19, 2002
Messages
43,275
What is this:

Set db = CurrentDb()
Set qdf = db.QueryDefs("qrySelQuizQuestions")
qdf("quiz") = Forms("frmSelectQuestions")![cmbSelectQuiz]
Set rs = qdf.OpenRecordset()
Set Me.Recordset = rs
 

ebs17

Well-known member
Local time
Today, 13:21
Joined
Feb 7, 2020
Messages
1,946
The latter approach allows me to send parameters to a saved query via querydefs.
That is a clear and well thought out statement.
Parameter queries are not just limited to the fact that parameters are supplied via form references and parameters then have to be assigned via the parameter list of the query object.
What is best is determined by specific cases.
- The evaluation of a stored procedure returns a recordset, only this one.
- A recordset object already contains the data. If loading and processing backend data is very time-consuming, but functional changes are necessary very often, it will be very valuable to work with the data available in the frontend and therefore not have to reload it every time.
- Sometimes you just already have a recordset object, for whatever reason. Then you can use it immediately:
=> as an argument for a method
=> Excel.CopyFromRecordset
=> Word.ConvertToTable
=> ADODB.Recordset.Getstring
=> disconnected Recordset
 
Last edited:

Users who are viewing this thread

Top Bottom