Dynamic population of a subform from an SQL query.

I

Ian Norris

I am dynamically populating a subform with data extracted
from a table
with code similar to

Dim strSQL as STRING
strSQL = "Select field1, field2, field3 from table"
Main_form!Sub_form.form.RecordSource = strSQL

The data enters the subform OK. I can tab through the data
and even change fields, but when I exit and go back into
the form the data in the subform has not been saved.

Also; after subform has just been populated; if I view
other records, data appears in the main form but not in
the subform (apart from the just populated subform
record). Exiting and reentering the form causes the
earlier subform records to reappear, but as I say above
the entered record has not been saved.

Do I need to anything after the .RecordSource command to
upate the table?
I have tried requerying the subform but that does not help.

Many Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top