Can't set Form's Record Source property in macro w/ expression bui

C

Chris v.

I've written two queries (returning different results using the same fields)
that can use the same form to display the data. I would like the end-user to
select a different command button, which would set the Record Source Property
of the form to the correct macro, so I can use only 1 form, having the 2
command buttons on the Switchboard. I don't seem to get the syntax in the
Expression Builder correct.
Is what I want to do not possible, or is it not a good way to do what I
want, or can someone show me an example of the correct syntax? For the
"Expression" in the Expression Builder I've tried various permutations of
[queries]![queryName] without luck.

Thanks, in advance.
Chris v.
 
C

Chris v.

OK ... so I'm replying to my own post. I firgured out that I have to OPEN the
form first, before setting the record source property. Now it makes sense,
but it seems that this would run the old query first, then have to run the
new query. That seems link extra work. Is this the only way to get the job
done or is there a better way?
 
S

Steve Schapel

Chris,

You could leave the form designed with no Record Source set, and then
use your macro in the Open event of the form to set it to the required
query.

But... what exactly is the difference between these two queries? It
seems likely you don't really need to have two separate queries anyway.
 
C

Chris v.

Steve,

I'm designing a database for a non-profit. The concept behind the two
different querries is: 1) to show all clients (including the data that has
been input along with empty fields for those clients whose data is not yet in
the system) vs 2) to show only the clients (and their data) whose paperwork
is turned in. I accomplish this by using different relationships between the
client table and the table holding specific data points about the client's
situation. Different people will have different needs when viewing the data,
and for some scrolling through all the clients (including those who don't
have their data in the system yet) would be a pain. Other users want to see
who is in the "system" and if they have completed the data collection
represented by the form.

Additionally, I've been thinking of using the same Access form (while
changing some labels in the macro that opens the form) for the EDIT screen
through which the Data Management Team inputs the data from the case
managers.

When I'm done, I hope to distribute two versions of the application to
different people: The Data Management Team will have both EDIT and VIEW
capabilities, while other managers will have only VIEW capabilities, linked
to the DATA TABLES that are stored on the file server. This agency has only a
file server and not a domain server. The goal is to prevent people from
inadvertantly changing the data as they have not used a database before.

Any and all suggestions / questions are appreciated. Thank you for your
response.

Chris v.
 

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