Hi,
I am opening a form in Continuous mode to list the records from a recordset
created in the calling form. The recordset object is declared as Public and
is set into the new form's Recordset property during the Open event.
According to the VBA Help file, setting the Recordset property may adjust
the RecordSource property accordingly.
If I set the RecordSource to blank in Design mode, it remains blank when the
form is opened even after the Recordset property is set. Worse, it results
in the form shrinking to display only one record at a time. You can scroll
the form to see the complete set of records, but only one at a time. This
was the subject of a recent posting -- no one was able to explain why this
was happening. However, I found that by populating RecordSource with the
name of the table used in the recordset, the full vertical length of the
form was restored and I was able to see all the records.
Since then, I have changed the query behind the recordset so that it now
contains a join of two tables -- the original table and a second table.
With RecordSource still set to the original table, I can display all the
columns in the recordset belonging to that table, but not those belonging to
the joined table.
The RecordSource property can only be set to a table, query or SQL
statement. I need to be able to set it to the recordset. I thought that
setting Recordset property might achieve that effectively (but apparently
not).
I have tried setting the controls displaying the joined table columns via
VBA in the Current event, but this sets the control in every row to the
value of the column in the first record only.
I hope that this makes sense so far. My question is: how can I display in
Continuous mode fields in a Public recordset resulting from a joined query
in another form? I will be happy if the solution is in the query's SQL, in
the form's properties or in VBA. Any help greatly appreciated.
--
Cheers,
Lyn.