how to set subform = recordset?

Rod C

Registered User.
Local time
Today, 17:51
Joined
Dec 19, 2001
Messages
41
I have a main form with a subform. The main form has unbound text and combo boxes which supply query criteria.

The criteria is used by a procedure to do two things. The procedure creates a recordset using the following set statement “Set rst = CurrentDb.OpenRecordset(strSql)” for the purpose of determining if any records in the database meet the criteria provided; it then closes the recordset and opens a form using the following do command.
“DoCmd.OpenForm "Find_Record_Subform1", , , , acFormReadOnly, , strSql”

The criteria from the main form is a string used as open arguments. The form that opens has the following in the forms On Load property.
Me.RecordSource = Me.OpenArgs

Rather than open a form I want the subform to display the records that meet the criteria. Is there a way to requery the subform and set it equal to the recordset? I want to do this in the module not with queries.
 

Users who are viewing this thread

Back
Top Bottom