Passing A Parameter From The Sheet View Of A Table To A Select Que

N

Nat Vascular

Hello and thanks so much for your help!

I have a simple table of Physicians that have the fields, Location and Group
(which is the Physician Group he/she belongs to). Both the Location field
and the Group field are populated from the Location Table and the Group
Table. The Group Table also has a Location field as well. Group A might be
in Location 1. In sheet view, when I add a Physician and enter his/her
Location, I want the Group field to be based on a Query of the Group table
returning all the Groups where there Location is also 1. I tried writing the
Query using the criteria box. I put in the criteria box [Tables]![Physician
Table]![Location] thinking the current Location field in the datasheet would
pass in as the parameter for the query, much like I have done in the past
with Form controls but it doesn't seem to work. Is this possible to do this
with sheet views of tables? Am I doing something wrong?

Thanks again for your help!

Mike
 
K

Klatuu

That will not work for tables. What you need to do is include your Group
table in your query.
 
N

Nat Vascular

Dave,

Thanks for your quick response! I am querying the Group table. I am
querying the Group table for all groups the have the same location as the
Physician I am adding. I am trying to reduce the selection of all Groups to
only those Groups that have the same Location as the Physician being added.
This query is then the basis of the combo box in the Physician Table to allow
the user to more easily select which Group the Physician belongs too.

So I am adding a Physician to the Physician Table......I add First and Last
Name, I add the Location and now I want to pass the location I just entered
to the query of the Group Table to find all Groups in that same location.
This query is the source for the lookup combo box the make adding the Group
the physician belongs too easier. I know I can do this on a form. I was
hoping to do this in the sheet view of the table. I this still something
that can't be done in the sheet view of a table?

Thanks again.....Mike

Klatuu said:
That will not work for tables. What you need to do is include your Group
table in your query.
--
Dave Hargis, Microsoft Access MVP


Nat Vascular said:
Hello and thanks so much for your help!

I have a simple table of Physicians that have the fields, Location and Group
(which is the Physician Group he/she belongs to). Both the Location field
and the Group field are populated from the Location Table and the Group
Table. The Group Table also has a Location field as well. Group A might be
in Location 1. In sheet view, when I add a Physician and enter his/her
Location, I want the Group field to be based on a Query of the Group table
returning all the Groups where there Location is also 1. I tried writing the
Query using the criteria box. I put in the criteria box [Tables]![Physician
Table]![Location] thinking the current Location field in the datasheet would
pass in as the parameter for the query, much like I have done in the past
with Form controls but it doesn't seem to work. Is this possible to do this
with sheet views of tables? Am I doing something wrong?

Thanks again for your help!

Mike
 
K

Klatuu

Can you post the SQL you are using currently? That may help.
--
Dave Hargis, Microsoft Access MVP


Nat Vascular said:
Dave,

Thanks for your quick response! I am querying the Group table. I am
querying the Group table for all groups the have the same location as the
Physician I am adding. I am trying to reduce the selection of all Groups to
only those Groups that have the same Location as the Physician being added.
This query is then the basis of the combo box in the Physician Table to allow
the user to more easily select which Group the Physician belongs too.

So I am adding a Physician to the Physician Table......I add First and Last
Name, I add the Location and now I want to pass the location I just entered
to the query of the Group Table to find all Groups in that same location.
This query is the source for the lookup combo box the make adding the Group
the physician belongs too easier. I know I can do this on a form. I was
hoping to do this in the sheet view of the table. I this still something
that can't be done in the sheet view of a table?

Thanks again.....Mike

Klatuu said:
That will not work for tables. What you need to do is include your Group
table in your query.
--
Dave Hargis, Microsoft Access MVP


Nat Vascular said:
Hello and thanks so much for your help!

I have a simple table of Physicians that have the fields, Location and Group
(which is the Physician Group he/she belongs to). Both the Location field
and the Group field are populated from the Location Table and the Group
Table. The Group Table also has a Location field as well. Group A might be
in Location 1. In sheet view, when I add a Physician and enter his/her
Location, I want the Group field to be based on a Query of the Group table
returning all the Groups where there Location is also 1. I tried writing the
Query using the criteria box. I put in the criteria box [Tables]![Physician
Table]![Location] thinking the current Location field in the datasheet would
pass in as the parameter for the query, much like I have done in the past
with Form controls but it doesn't seem to work. Is this possible to do this
with sheet views of tables? Am I doing something wrong?

Thanks again for your help!

Mike
 

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