Filter a subform based on AfterUpdate event of a Frame

G

Guest

I have a subform which displays data from a main table. In this table I have
a code-generated index field (well, technically it's done with update
queries) which the database updates with certain tags, depending on what part
of the process the data has been run through. (There are eight different flow
processes for the incoming data to run through, depending on certain
criteria, and some of the data goes through more than one flow process, so
the LAST tag is the most important.) What I need to do is filter the data in
the subform based on the tags in this index. I have a frame that has values 1
through 9 assigned to the different filters I need (the 8 flow processes, and
then all data). The filter function is working, but I can't seem to figure
out how to update the subform. I tried calling it with Forms![Subform
Name].Filter, but it says it can't find the form. How do you reference a
subform from the parent form?
 
G

Guest

I figured out the problem, but now I have another issue. I need to filter the
data first by the index tags, and then by the transaction type. However, when
I set up the second filter, it clears the original filter out. I can filter
it multiple times manually, but is there a way to do this via code?

Roger Carlson said:
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "SubformReference.mdb" which explains how to reference various
objects on subforms and subsubforms.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


Nicholas Scarpinato said:
I have a subform which displays data from a main table. In this table I have
a code-generated index field (well, technically it's done with update
queries) which the database updates with certain tags, depending on what part
of the process the data has been run through. (There are eight different flow
processes for the incoming data to run through, depending on certain
criteria, and some of the data goes through more than one flow process, so
the LAST tag is the most important.) What I need to do is filter the data in
the subform based on the tags in this index. I have a frame that has values 1
through 9 assigned to the different filters I need (the 8 flow processes, and
then all data). The filter function is working, but I can't seem to figure
out how to update the subform. I tried calling it with Forms![Subform
Name].Filter, but it says it can't find the form. How do you reference a
subform from the parent form?
 
R

Roger Carlson

Frankly, I wouldn't set a filter. Instead, I would programmatically set the
Record Source for the form that included the criteria that your filter uses.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L



Nicholas Scarpinato said:
I figured out the problem, but now I have another issue. I need to filter the
data first by the index tags, and then by the transaction type. However, when
I set up the second filter, it clears the original filter out. I can filter
it multiple times manually, but is there a way to do this via code?

Roger Carlson said:
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "SubformReference.mdb" which explains how to reference various
objects on subforms and subsubforms.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


in message news:D[email protected]...
I have a subform which displays data from a main table. In this table
I
have
a code-generated index field (well, technically it's done with update
queries) which the database updates with certain tags, depending on
what
part
of the process the data has been run through. (There are eight
different
flow
processes for the incoming data to run through, depending on certain
criteria, and some of the data goes through more than one flow process, so
the LAST tag is the most important.) What I need to do is filter the
data
in
the subform based on the tags in this index. I have a frame that has values 1
through 9 assigned to the different filters I need (the 8 flow
processes,
and
then all data). The filter function is working, but I can't seem to figure
out how to update the subform. I tried calling it with Forms![Subform
Name].Filter, but it says it can't find the form. How do you reference a
subform from the parent form?
 
G

Guest

Excellent idea! I knew there was a better way of doing this. Funny thing is,
I have another form in the database that I planned on using code to change
it's recordsource so I could use one form for multiple tables. Thanks very
much!

Roger Carlson said:
Frankly, I wouldn't set a filter. Instead, I would programmatically set the
Record Source for the form that included the criteria that your filter uses.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L



Nicholas Scarpinato said:
I figured out the problem, but now I have another issue. I need to filter the
data first by the index tags, and then by the transaction type. However, when
I set up the second filter, it clears the original filter out. I can filter
it multiple times manually, but is there a way to do this via code?

Roger Carlson said:
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "SubformReference.mdb" which explains how to reference various
objects on subforms and subsubforms.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


in message I have a subform which displays data from a main table. In this table I
have
a code-generated index field (well, technically it's done with update
queries) which the database updates with certain tags, depending on what
part
of the process the data has been run through. (There are eight different
flow
processes for the incoming data to run through, depending on certain
criteria, and some of the data goes through more than one flow process, so
the LAST tag is the most important.) What I need to do is filter the data
in
the subform based on the tags in this index. I have a frame that has
values 1
through 9 assigned to the different filters I need (the 8 flow processes,
and
then all data). The filter function is working, but I can't seem to figure
out how to update the subform. I tried calling it with Forms![Subform
Name].Filter, but it says it can't find the form. How do you reference a
subform from the parent form?
 
G

Guest

It took a little doing, but that worked out perfectly. I set up a small query
to run the same set of data as the filter, went to SQL view and copied the
query, then pasted it into my "[Formname].Form.Recordsource =" line in the
code. After modifying the SQL as necessary for each breakdown, every one
works exactly how I need.

Roger Carlson said:
Frankly, I wouldn't set a filter. Instead, I would programmatically set the
Record Source for the form that included the criteria that your filter uses.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L



Nicholas Scarpinato said:
I figured out the problem, but now I have another issue. I need to filter the
data first by the index tags, and then by the transaction type. However, when
I set up the second filter, it clears the original filter out. I can filter
it multiple times manually, but is there a way to do this via code?

Roger Carlson said:
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "SubformReference.mdb" which explains how to reference various
objects on subforms and subsubforms.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


in message I have a subform which displays data from a main table. In this table I
have
a code-generated index field (well, technically it's done with update
queries) which the database updates with certain tags, depending on what
part
of the process the data has been run through. (There are eight different
flow
processes for the incoming data to run through, depending on certain
criteria, and some of the data goes through more than one flow process, so
the LAST tag is the most important.) What I need to do is filter the data
in
the subform based on the tags in this index. I have a frame that has
values 1
through 9 assigned to the different filters I need (the 8 flow processes,
and
then all data). The filter function is working, but I can't seem to figure
out how to update the subform. I tried calling it with Forms![Subform
Name].Filter, but it says it can't find the form. How do you reference a
subform from the parent form?
 

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