Show query results on a form

H

H access

I currently have a form which I would like to use to display results from
various queries for other users to update. Some of these users have very
limited knowledge of Access. I designed one form and then copied and renamed
it to use with each of the queries, and changed the record source of each
individual form to correspond to the query I wanted.

Question -- is there a way to only use the main form (and update the form
design only once if changes to the form are requested...) and enable the
users to select which query results to display?

Thanks so much for your help!
 
M

ManningFan

"Some of these users have very limited knowledge of Access."
I hope you're not one of them...

Look into the RecordSource property of a form.
 
H

H access

I do have the query listed in the RecordSource property of the form. Is
there a way to vary this based on the users selection. Currently I have a
command button on the switchboard for each individual form, but would like to
have this go to some kind of parameter or something so that the user can then
select which query results to display in the form. Does this make sense? I
just know that they're going to want changes to the form down the road (boss
keeps saying that they'll review it once they start using it...) and I want
to not have to change it on fifteen versions of the form if I can avoid it.

Right now what I did was to make the one form. Then, copied it multiple
times and updated the RecordSource for each one. Just seems like there
should be a better way... Thanks again!

Just enough knowledge to be dangerous. ;)
"Some of these users have very limited knowledge of Access."
I hope you're not one of them...

Look into the RecordSource property of a form.
I currently have a form which I would like to use to display results from
various queries for other users to update. Some of these users have very
[quoted text clipped - 7 lines]
Thanks so much for your help!
 
M

ManningFan

You can set up a table with the dropdown names and the SQL for each
option. On the AfterUpdate event, call the SQL and stick it in the
recordsource.

For example:
Me.RecordSource = Me.Combo.Column(2)

100% scalable, adding new views is as simple as adding a new row to the
table.

H said:
I do have the query listed in the RecordSource property of the form. Is
there a way to vary this based on the users selection. Currently I have a
command button on the switchboard for each individual form, but would like to
have this go to some kind of parameter or something so that the user can then
select which query results to display in the form. Does this make sense? I
just know that they're going to want changes to the form down the road (boss
keeps saying that they'll review it once they start using it...) and I want
to not have to change it on fifteen versions of the form if I can avoid it.

Right now what I did was to make the one form. Then, copied it multiple
times and updated the RecordSource for each one. Just seems like there
should be a better way... Thanks again!

Just enough knowledge to be dangerous. ;)
"Some of these users have very limited knowledge of Access."
I hope you're not one of them...

Look into the RecordSource property of a form.
I currently have a form which I would like to use to display results from
various queries for other users to update. Some of these users have very
[quoted text clipped - 7 lines]
Thanks so much for your help!
 
H

H access

This sounds great, but I guess I'm not as "dangerous" as I thought... ;)
Could you give me a little more detail. Thanks again!
You can set up a table with the dropdown names and the SQL for each
option. On the AfterUpdate event, call the SQL and stick it in the
recordsource.

For example:
Me.RecordSource = Me.Combo.Column(2)

100% scalable, adding new views is as simple as adding a new row to the
table.
I do have the query listed in the RecordSource property of the form. Is
there a way to vary this based on the users selection. Currently I have a
[quoted text clipped - 21 lines]
 
M

ManningFan

<shudder>

I don't write other people's code, because they don't learn when I hand
them something. However, I'll elaborate a bit more on this.

Build a table with 3 fields; OptionID, OptionName and qSQL. Populate
your combo box with this table, setting the Column widths to be
0";1.5";0". OptionID will be an AutoNumber field, the other 2 are
Text. Put the SQL of your query in the qSQL field.

When the click on the combo box, it will pull all 3 columns into it,
but only display the OptionName field. Therefore, you can pull the
qSQL in by calling the (hidden) column of your combo:

MySQL = Me.Combo.Column(2)

Then you can set your RecordSource to be equal to MySQL. You would do
this on the AfterUpdate property of the combo.

That's all you're getting, Grasshopper. Use your intuition (or a good
search engine) to fill in the rest.
 

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