Populating a subform or child form dynamically

G

Guest

Hi,

I am writing an Access app in which I have many tables. I am trying to
develop a Wizard driven interface that will on one screen, allow the user to
choose thier table, then on the next screen, open the table in a subform in
datasheet view.

The problem is that I also need to filter the table selected based on the
current record from the main screen.

I have gotten it to the point where I can select the table, then, with an
unbound child form on the next screen, set the SourceObject to the table name
selected, but I cannot figure out how to filter that table so that only the
relevant records are displayed within the subform.

Anyone have any ideas?

Thanks,

Mike
 
A

Albert D.Kallal

Just stuff in the sql as you please with the conditions....and forget about
filters...

To show all people from tblCstomres and form my city, you get:

dim strSql as string

strSql = "select * from tblCustomers where City = 'Edmonton'"

me.MySubFormname.Form.RecordSource = strSq

So, you can make the sql anything you want. however, you do have the issue
of what controls are on the form, and what fields they will show.
 

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