Passing multiplee records to Man Form

T

Tony Scullion

HI Group,

Simple question - hopefully simple answer.

My db contains over 400 records. A search form lists 19
records that match my criteria - the question is - how do
I open up my main form to show these 19 records only.

Thanks

Tony
 
N

Neil

Hello Tony,

Your Search form will have the filter that is currently being applied in its
..Filter property. Therefore, in a command button for example you could use
something like:

DoCmd.OpenForm "frmMain"
' Copy the filter
frmMain.Filter = frmSearch.Filter
frmMain.FilterOn = True
' Requery the form (this may not be needed...)
frmMain.Requery

Hope this gives you some ideas to solving your problem.

Neil.
 
N

Newbie

Set the datasource for your form to be a query which has the criteria for
the records that you want shown.
you can do this by using inputboxes or have a form from which you select the
criteria and then take this info to the query for the main form:

eg

form 1 text1.value = Sunday (you to select this on your form)

amend your query for the main form so that it has in the criteria for
day(for example)
=forms!form1!text1.value

then base your main form on the query

NB form 1 needs to be open at the time of opening the main form

HTH
 
N

Neil

Tony,

What VBA routine changes the SQL statement? It may be possible to manipulate
the SQL string (just leaving the where clause) and then use that in the
..Filter property of the main form.

I dont mind if you want to email me your DB (size doesn't matter) and i'll
probably be able to solve the problem if I can see exactly what is
happening.

Neil.
 
T

Tony Scullion

Neil,

Thanks for your offer of help - much appreciated. I'll
scale the db and send you a zipped copy.

Regards

Tony
 
T

Tony Scullion

Neil,

Hope I am not hassling you here - I was wondering have you
had any success with the db that I sent.

Regards

Tony
 
N

Neil

Tony,

Still waiting for your db....

Try sending to (e-mail address removed) instead.

Neil.
 

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