How to bind ADODB recordset to SubForm ?

cheer

Registered User.
Local time
Tomorrow, 01:23
Joined
Oct 30, 2009
Messages
222
I know how to bind ADODB recordset to MainForm, how about the SubForm ? Can anyone suggest as I have worked out the below through Main form concept, however, it won't work for SubForm. Codes that I have tried it out are :-

1) Forms![MainForm]![SubForm].Form.Recordset = rsTemp
2) Forms.MainForm.SubForm.Recordset = rsTemp
3) Me!SubForm.Recordset = rsTemp
4) Me!Parent.SubForm.Recordset = rsTemp
5) Me.Parent!SubForm.Recordset = rsTemp

All the above produce error.
 
From outside the form, use
set Forms![MainForm]![SubForm].Form.Recordset = rsTemp

In the parent form, use
set me![SubForm].Form.Recordset = rsTemp

In the subform, use
set me.recordset = rstTemp

The above assume MainForm is the name of the parent form and SubForm, the name of the subform
 

Users who are viewing this thread

Back
Top Bottom