Access to MS: how to programmatically add a subform

Is there a way to programmatically add a subform to a form using Access VBA? I have a temporary table that is generated dynamically by user request. If possible, I would like to create a form based on a temporary table and add it as a subform to an existing form.

+4
source share
1 answer

It is best to create a subform control and set the source object to either a table or a query.

Me.NameOfSubformControl.SourceObject = "Query.Query1" Me.NameOfSubformControl.SourceObject = "Table.Temp" 

You can also update the sql of the saved query to reference the new temp table.

+4
source

All Articles