druppert@ruppertweb.com (Dennis Ruppert) wrote in message news:<f7160683.0407100641.78c45f@posting.google.co m>...[color=blue]
> Greetings
>
> This is rather ambitious:
>
> I have a split database that contains many different reports. I have a
> form that the end user launches the reports from. They select the
> report criteria from several combo boxes, click a "Go" command button
> to launch the report. I then pass the report criteria to various
> report "templates" as an SQL string.
>
> I would like to have a section of the report form, or a new form, have
> command buttons for the end user to store their most commonly used
> combinations of reports/criteria. They would select their criteria,
> then press an "Add to Favorites" button, be prompted for a "favorites
> name", then click OK. The end result would create a new command
> button,(or make an existing one visible), then change a label to their
> chosen "Favorites" name. Obviously, their criteria would need to be
> stored, also.
>
> I am flexible on how I accomplish this. I am just looking for some
> basic outlines on how this might be done. I started an attempt at this
> with a command button that had a complex IIf behind it, looking at the
> machine name, but it quickly got too confusing!
>
> Has anyone here ever done something similar to this? Or, am I outside
> the realm of Access?
>
> I am not a "power programmer", but I can usually muddle my through
> relatively complex stuff. Also, I would prefer not to involve Access
> security in this, but if necessary.........
>
> Any ideas would be appreciated.
>
> Thanks in advance,
>
> Dennis[/color]
Rather than a command button I would use a list box.
That way you don't have to guess how many buttons might be needed (to
either hide them, or allow for the space on screen)
By using a list box you could store the SQL string in a 3 field table.
(IDNum(Primary Key), FavoriteName, SqlText)
Then display the FavoriteName in the list box, but use the sqlText
column (hidden) in the GO command procedure.
You will need to explore storing and handling "" marks, but I'm
guessing that you probably have already tackled that as you gather
this info and pass it on in your current method.
I have used this approach to have a "GO" button that opens reports, or
forms as selected from a list box. I have another column that defines
the TYPE form, report etc. that I then test for and do either a
docmd.openform.... or openreport....
HTH
Mal.