HiAspire
Technical User
- Oct 17, 2002
- 10
This maybe quite simple, I'm not sure. Don't do a ton of Access programming and have done something similar with a report before but couldn't locate that old code. This example isn't quite the situation but describes a similar sceanrio I'm trying to achieve.
Say I have a query in Access that shows all projects for every employee or rep based on active status. I can create a command button on a form which will open that general Query for me to see all of the active projects for all employee/reps. For example:
Dim stDocName As String
stDocName = "All Active Projects"
DoCmd.OpenQuery stDocName, acNormal, acEdit
On this form there is a field for the employee/rep associated with each project record. Hundreds of records, dozens of different employee/reps. Each record has one person listed as responsible for it.
What I really want to do is put that Run Query button next to the field on the form with someone's name on it, and have that query be personalized to only show me the records which have that employee/rep associated with them.
Seems simple enough, but I'm a little rusty getting back into it. Can criteria perameters be passed to the general query in that OpenQuery command based on the value of the current record in the form?
I believe the OpenReport command has a "Where Condition" associated with it to filter the results. Can something similar be done with opening a query?
Say I have a query in Access that shows all projects for every employee or rep based on active status. I can create a command button on a form which will open that general Query for me to see all of the active projects for all employee/reps. For example:
Dim stDocName As String
stDocName = "All Active Projects"
DoCmd.OpenQuery stDocName, acNormal, acEdit
On this form there is a field for the employee/rep associated with each project record. Hundreds of records, dozens of different employee/reps. Each record has one person listed as responsible for it.
What I really want to do is put that Run Query button next to the field on the form with someone's name on it, and have that query be personalized to only show me the records which have that employee/rep associated with them.
Seems simple enough, but I'm a little rusty getting back into it. Can criteria perameters be passed to the general query in that OpenQuery command based on the value of the current record in the form?
I believe the OpenReport command has a "Where Condition" associated with it to filter the results. Can something similar be done with opening a query?