Subform as datasheet question

J

jpm

Hello,

Access 2007 mdb file
Using DAO in VBA module of a form to query data from SQL Server and make a
local table.
I would like to display the data on a subform presented in datasheet view.

i.e. I'm not binding any data to the parent form . . . .don't want or need
to. I do want to bind a dao recordset to the subform for display purposes.
It isn't immediately apparent to me how to do this. Obviously this isn't
the typical parent/child relationship with bound data. Can I do this and
can some of the experts on this group provide a few pointers?


Thanks in advance,
Jim M.

Admin: Sorry, previously mis-posted to wrong forum/group.
 
J

Jon Lewis

If the data that you want to display in the subform changes as you change
records in the parent form then you could set the RecordSource for the
subform in the Current Event of the main form:
Me.NameofsubFormControl.Form.RecordSource = LocalTablename or SQL Statement

or if the data is not dependent on the main form record then in the subform
Open Event:
Me.RecordSource = LocalTablename or SQL Statement

HTH
 

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