Using focus as a criteria

G

Guest

I have a subform that is based on a query. The results are displayed on
screen. When a user clicks anywhere on a specific row, I want another query
to run that gives details on that clicked item. I can get the query to run
when a row is clicked, but I cannot figure out how to refine the results to
only those related to the clicked item.

Thanks!
 
J

Jeff Boyce

Are you talking about Access? Access doesn't have "rows" (that's a
spreadsheetly term).

How are you displaying records in your form (subform)? As a datasheet? As
a continuous form?

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

the records are being displayed as a continuous form. Conceptually, I want
to use the record with focus (clicked by user) as criteria in another query.

Thanks for the help...

-jeff s.
 
J

Jeff Boyce

So, within the form that is being used as a subform, do you have a
particular control/field that users will "click" to highlight? You could
use the GotFocus event of that control to run your code (i.e., run a query).
Usually, though, you'd want the data to show up, not as a query, but as
information in a form.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

You're exactly right, I do eventually want results in another subform.
Ultimately, this is where I'm going:

Subform1 (query results from elsewhere):
[Company], [Attribute2],etc. (there will be a handfull of records displayed)

"RelatedQuery"
click any [Company] from Subform1 and
select a [DataSource] (drop down menu)

Subform2 ("RelatedQuery" results):
[Company Detail1], [ Company Detail2], etc.

Automatically requery when different [Company] clicked or [DataSource]
selected.

**I think my problem is that I don't know how to set the criteria in
"RelatedQuery" so that it will only show results pertaining to the [Company]
clicked.

I think I'm starting to learn how to express my questions :)

Thanks,

jeff
 
J

Jeff Boyce

So, if you start with a main form and have related records in a subform, and
then want to see records related to a row/record in the subform, why not
embed a sub(sub)form within the subform?

Regards

Jeff Boyce
Microsoft Office/Access MVP


jas580 said:
You're exactly right, I do eventually want results in another subform.
Ultimately, this is where I'm going:

Subform1 (query results from elsewhere):
[Company], [Attribute2],etc. (there will be a handfull of records
displayed)

"RelatedQuery"
click any [Company] from Subform1 and
select a [DataSource] (drop down menu)

Subform2 ("RelatedQuery" results):
[Company Detail1], [ Company Detail2], etc.

Automatically requery when different [Company] clicked or [DataSource]
selected.

**I think my problem is that I don't know how to set the criteria in
"RelatedQuery" so that it will only show results pertaining to the
[Company]
clicked.

I think I'm starting to learn how to express my questions :)

Thanks,

jeff


Jeff Boyce said:
So, within the form that is being used as a subform, do you have a
particular control/field that users will "click" to highlight? You could
use the GotFocus event of that control to run your code (i.e., run a
query).
Usually, though, you'd want the data to show up, not as a query, but as
information in a form.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

I need the Subform1 as continuous forms so I can always see those results
while the Subform2 is single form displaying only the details related to the
record clicked in Subform1. If I could just figure out how to use the focus
of Subform1 as criteria, then I'll be moving forward. Once I figure that
out, then I'll know if I need to make adjustments.

thanks,

jeff

Jeff Boyce said:
So, if you start with a main form and have related records in a subform, and
then want to see records related to a row/record in the subform, why not
embed a sub(sub)form within the subform?

Regards

Jeff Boyce
Microsoft Office/Access MVP


jas580 said:
You're exactly right, I do eventually want results in another subform.
Ultimately, this is where I'm going:

Subform1 (query results from elsewhere):
[Company], [Attribute2],etc. (there will be a handfull of records
displayed)

"RelatedQuery"
click any [Company] from Subform1 and
select a [DataSource] (drop down menu)

Subform2 ("RelatedQuery" results):
[Company Detail1], [ Company Detail2], etc.

Automatically requery when different [Company] clicked or [DataSource]
selected.

**I think my problem is that I don't know how to set the criteria in
"RelatedQuery" so that it will only show results pertaining to the
[Company]
clicked.

I think I'm starting to learn how to express my questions :)

Thanks,

jeff


Jeff Boyce said:
So, within the form that is being used as a subform, do you have a
particular control/field that users will "click" to highlight? You could
use the GotFocus event of that control to run your code (i.e., run a
query).
Usually, though, you'd want the data to show up, not as a query, but as
information in a form.

Regards

Jeff Boyce
Microsoft Office/Access MVP


the records are being displayed as a continuous form. Conceptually, I
want
to use the record with focus (clicked by user) as criteria in another
query.

Thanks for the help...

-jeff s.


:

Are you talking about Access? Access doesn't have "rows" (that's a
spreadsheetly term).

How are you displaying records in your form (subform)? As a
datasheet?
As
a continuous form?

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP

I have a subform that is based on a query. The results are displayed
on
screen. When a user clicks anywhere on a specific row, I want
another
query
to run that gives details on that clicked item. I can get the query
to
run
when a row is clicked, but I cannot figure out how to refine the
results
to
only those related to the clicked item.

Thanks!
 
J

Jeff Boyce

Just as subform1 should be displaying the "many" records for whatever main
form record is selected (that IS what you are doing, right?), the subform2
could display the "many" (or even just "one") of the record selected in the
subform1.

How are you getting the list/continuous subform records now for subform1?

Regards

Jeff Boyce
Microsoft Office/Access MVP

jas580 said:
I need the Subform1 as continuous forms so I can always see those results
while the Subform2 is single form displaying only the details related to
the
record clicked in Subform1. If I could just figure out how to use the
focus
of Subform1 as criteria, then I'll be moving forward. Once I figure that
out, then I'll know if I need to make adjustments.

thanks,

jeff

Jeff Boyce said:
So, if you start with a main form and have related records in a subform,
and
then want to see records related to a row/record in the subform, why not
embed a sub(sub)form within the subform?

Regards

Jeff Boyce
Microsoft Office/Access MVP


jas580 said:
You're exactly right, I do eventually want results in another subform.
Ultimately, this is where I'm going:

Subform1 (query results from elsewhere):
[Company], [Attribute2],etc. (there will be a handfull of records
displayed)

"RelatedQuery"
click any [Company] from Subform1 and
select a [DataSource] (drop down menu)

Subform2 ("RelatedQuery" results):
[Company Detail1], [ Company Detail2], etc.

Automatically requery when different [Company] clicked or [DataSource]
selected.

**I think my problem is that I don't know how to set the criteria in
"RelatedQuery" so that it will only show results pertaining to the
[Company]
clicked.

I think I'm starting to learn how to express my questions :)

Thanks,

jeff


:

So, within the form that is being used as a subform, do you have a
particular control/field that users will "click" to highlight? You
could
use the GotFocus event of that control to run your code (i.e., run a
query).
Usually, though, you'd want the data to show up, not as a query, but
as
information in a form.

Regards

Jeff Boyce
Microsoft Office/Access MVP


the records are being displayed as a continuous form. Conceptually,
I
want
to use the record with focus (clicked by user) as criteria in
another
query.

Thanks for the help...

-jeff s.


:

Are you talking about Access? Access doesn't have "rows" (that's a
spreadsheetly term).

How are you displaying records in your form (subform)? As a
datasheet?
As
a continuous form?

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP

I have a subform that is based on a query. The results are
displayed
on
screen. When a user clicks anywhere on a specific row, I want
another
query
to run that gives details on that clicked item. I can get the
query
to
run
when a row is clicked, but I cannot figure out how to refine the
results
to
only those related to the clicked item.

Thanks!
 
G

Guest

I just got rid of Subform1 and replaced it with a list box. Now the "focus"
is taken care of automatically. No idea why I didn't think of this from the
start...

Thanks for your help,

jeff



Jeff Boyce said:
Just as subform1 should be displaying the "many" records for whatever main
form record is selected (that IS what you are doing, right?), the subform2
could display the "many" (or even just "one") of the record selected in the
subform1.

How are you getting the list/continuous subform records now for subform1?

Regards

Jeff Boyce
Microsoft Office/Access MVP

jas580 said:
I need the Subform1 as continuous forms so I can always see those results
while the Subform2 is single form displaying only the details related to
the
record clicked in Subform1. If I could just figure out how to use the
focus
of Subform1 as criteria, then I'll be moving forward. Once I figure that
out, then I'll know if I need to make adjustments.

thanks,

jeff

Jeff Boyce said:
So, if you start with a main form and have related records in a subform,
and
then want to see records related to a row/record in the subform, why not
embed a sub(sub)form within the subform?

Regards

Jeff Boyce
Microsoft Office/Access MVP


You're exactly right, I do eventually want results in another subform.
Ultimately, this is where I'm going:

Subform1 (query results from elsewhere):
[Company], [Attribute2],etc. (there will be a handfull of records
displayed)

"RelatedQuery"
click any [Company] from Subform1 and
select a [DataSource] (drop down menu)

Subform2 ("RelatedQuery" results):
[Company Detail1], [ Company Detail2], etc.

Automatically requery when different [Company] clicked or [DataSource]
selected.

**I think my problem is that I don't know how to set the criteria in
"RelatedQuery" so that it will only show results pertaining to the
[Company]
clicked.

I think I'm starting to learn how to express my questions :)

Thanks,

jeff


:

So, within the form that is being used as a subform, do you have a
particular control/field that users will "click" to highlight? You
could
use the GotFocus event of that control to run your code (i.e., run a
query).
Usually, though, you'd want the data to show up, not as a query, but
as
information in a form.

Regards

Jeff Boyce
Microsoft Office/Access MVP


the records are being displayed as a continuous form. Conceptually,
I
want
to use the record with focus (clicked by user) as criteria in
another
query.

Thanks for the help...

-jeff s.


:

Are you talking about Access? Access doesn't have "rows" (that's a
spreadsheetly term).

How are you displaying records in your form (subform)? As a
datasheet?
As
a continuous form?

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP

I have a subform that is based on a query. The results are
displayed
on
screen. When a user clicks anywhere on a specific row, I want
another
query
to run that gives details on that clicked item. I can get the
query
to
run
when a row is clicked, but I cannot figure out how to refine the
results
to
only those related to the clicked item.

Thanks!
 

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