PhillipsAndrew
Registered User.
- Local time
- Today, 00:55
- Joined
- Aug 7, 2003
- Messages
- 21
Here's one,
I have two related tables in my database. They contain the names of departments, who is in those departments and whether they have the relevant authorisation to approve orders etc..
The database deals with orders, so in several places I need to check if the person logged into the database belongs to the correct department and has the relevant authorisation.
I have no problem designing queries on this, using information from the form as the criteria eg [Forms]![Choose Bid List]![Directorate] etc..
My question is this:
Since I need this information on several forms, how do I avoid having lots of different queries to match each form?
Is there a way that I can have just one query and dynamically change the form name used in its criteria?
OR:
Shoud I re-write the query in a module, so not have a query at all but use Recordsets etc. to 'manually' extract the info I need. This way I have reusable code, able to be called from anywhere in the database.
Which way is best?
Thanks
P
I have two related tables in my database. They contain the names of departments, who is in those departments and whether they have the relevant authorisation to approve orders etc..
The database deals with orders, so in several places I need to check if the person logged into the database belongs to the correct department and has the relevant authorisation.
I have no problem designing queries on this, using information from the form as the criteria eg [Forms]![Choose Bid List]![Directorate] etc..
My question is this:
Since I need this information on several forms, how do I avoid having lots of different queries to match each form?
Is there a way that I can have just one query and dynamically change the form name used in its criteria?
OR:
Shoud I re-write the query in a module, so not have a query at all but use Recordsets etc. to 'manually' extract the info I need. This way I have reusable code, able to be called from anywhere in the database.
Which way is best?
Thanks
P