Filter troubles

D

Degul2000

I have a subform where "on double-click" runs a macro, mac_EditChild. I
can't seem to get the WHERE filter to work. It either returns no results or
all the entries in the table. In the macro, I have

[Child_ID]=[Forms]![frm_Child]![Child_ID]

This doesn't work!!! Is it the subform?
 
S

Steve Schapel

Degul,

What are the actions in the macro? What is the name of the subform?
What is frm_Child? What are you trying to achieve?
 
D

Degul2000

I have a form called frm_ParentInfo where I have information about the
parents of children who are taking certain classes. In this form, I have the
parent's name
([Parent_Firstname_1],[Parent_Lastname_1],[Parent_Firstname_2],[Parent_Lastname_2]), Address, telephone number, e-mail, etc.

In the Parent Info form, I have a subform (subfrm_Child) which has the
synopsis of another form (frm_ChildInfo). The subform shows only the first
name of the child, the age, their gender, the class the child is enrolled in.
These two forms (frm_ParentInfo and frm_ChildInfo) are linked by the
autonumbered key field in the parent form ([Parent_ID]). Unlike the subform,
the main Child form (frm_ChildInfo) has detailed information about the
child-- a different address if they are not living in the same domicile as
their parents, special learning/medical needs, etc.

From the main Parent form, I want to have the user be able to double-click
on the child's first name on the subform (subfrm_Child) and have that open
the main child form (frm_ChildInfo) so they can get detailed information
about that child they have selected.

So in the subform, I have an event "on dbl click" called "mac_EditChild."
This is an OpenForm which opens the form "frm_ChildInfo" in Form View in Edit
Mode. My problem is the WHERE statement.

Thanks.





Steve Schapel said:
Degul,

What are the actions in the macro? What is the name of the subform?
What is frm_Child? What are you trying to achieve?

--
Steve Schapel, Microsoft Access MVP

I have a subform where "on double-click" runs a macro, mac_EditChild. I
can't seem to get the WHERE filter to work. It either returns no results or
all the entries in the table. In the macro, I have

[Child_ID]=[Forms]![frm_Child]![Child_ID]

This doesn't work!!! Is it the subform?
 
S

Steve Schapel

Degul,

Thanks for the superb explanation.

[Child_ID]=[Forms]![frm_ParentInfo]![subfrm_Child].[Form]![Child_ID]
 
D

Degul2000

THANK YOU! THANK YOU! THANK YOU!



Steve Schapel said:
Degul,

Thanks for the superb explanation.

[Child_ID]=[Forms]![frm_ParentInfo]![subfrm_Child].[Form]![Child_ID]

--
Steve Schapel, Microsoft Access MVP

I have a form called frm_ParentInfo where I have information about the
parents of children who are taking certain classes. In this form, I have the
parent's name
([Parent_Firstname_1],[Parent_Lastname_1],[Parent_Firstname_2],[Parent_Lastname_2]), Address, telephone number, e-mail, etc.

In the Parent Info form, I have a subform (subfrm_Child) which has the
synopsis of another form (frm_ChildInfo). The subform shows only the first
name of the child, the age, their gender, the class the child is enrolled in.
These two forms (frm_ParentInfo and frm_ChildInfo) are linked by the
autonumbered key field in the parent form ([Parent_ID]). Unlike the subform,
the main Child form (frm_ChildInfo) has detailed information about the
child-- a different address if they are not living in the same domicile as
their parents, special learning/medical needs, etc.

From the main Parent form, I want to have the user be able to double-click
on the child's first name on the subform (subfrm_Child) and have that open
the main child form (frm_ChildInfo) so they can get detailed information
about that child they have selected.

So in the subform, I have an event "on dbl click" called "mac_EditChild."
This is an OpenForm which opens the form "frm_ChildInfo" in Form View in Edit
Mode. My problem is the WHERE statement.
 
M

Melissa

Steve,

How would you do this if you had pages with subforms within a form

Steve Schapel said:
Degul,

Thanks for the superb explanation.

[Child_ID]=[Forms]![frm_ParentInfo]![subfrm_Child].[Form]![Child_ID]

--
Steve Schapel, Microsoft Access MVP

I have a form called frm_ParentInfo where I have information about the
parents of children who are taking certain classes. In this form, I have the
parent's name
([Parent_Firstname_1],[Parent_Lastname_1],[Parent_Firstname_2],[Parent_Lastname_2]), Address, telephone number, e-mail, etc.

In the Parent Info form, I have a subform (subfrm_Child) which has the
synopsis of another form (frm_ChildInfo). The subform shows only the first
name of the child, the age, their gender, the class the child is enrolled in.
These two forms (frm_ParentInfo and frm_ChildInfo) are linked by the
autonumbered key field in the parent form ([Parent_ID]). Unlike the subform,
the main Child form (frm_ChildInfo) has detailed information about the
child-- a different address if they are not living in the same domicile as
their parents, special learning/medical needs, etc.

From the main Parent form, I want to have the user be able to double-click
on the child's first name on the subform (subfrm_Child) and have that open
the main child form (frm_ChildInfo) so they can get detailed information
about that child they have selected.

So in the subform, I have an event "on dbl click" called "mac_EditChild."
This is an OpenForm which opens the form "frm_ChildInfo" in Form View in Edit
Mode. My problem is the WHERE statement.
 
D

Douglas J. Steele

Having the subforms on separate pages of a tab control doesn't change
anything.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Melissa said:
Steve,

How would you do this if you had pages with subforms within a form

Steve Schapel said:
Degul,

Thanks for the superb explanation.

[Child_ID]=[Forms]![frm_ParentInfo]![subfrm_Child].[Form]![Child_ID]

--
Steve Schapel, Microsoft Access MVP

I have a form called frm_ParentInfo where I have information about the
parents of children who are taking certain classes. In this form, I
have the
parent's name
([Parent_Firstname_1],[Parent_Lastname_1],[Parent_Firstname_2],[Parent_Lastname_2]),
Address, telephone number, e-mail, etc.

In the Parent Info form, I have a subform (subfrm_Child) which has the
synopsis of another form (frm_ChildInfo). The subform shows only the
first
name of the child, the age, their gender, the class the child is
enrolled in.
These two forms (frm_ParentInfo and frm_ChildInfo) are linked by the
autonumbered key field in the parent form ([Parent_ID]). Unlike the
subform,
the main Child form (frm_ChildInfo) has detailed information about the
child-- a different address if they are not living in the same domicile
as
their parents, special learning/medical needs, etc.

From the main Parent form, I want to have the user be able to
double-click
on the child's first name on the subform (subfrm_Child) and have that
open
the main child form (frm_ChildInfo) so they can get detailed
information
about that child they have selected.

So in the subform, I have an event "on dbl click" called
"mac_EditChild."
This is an OpenForm which opens the form "frm_ChildInfo" in Form View
in Edit
Mode. My problem is the WHERE statement.
 
M

Melissa

How would I write it.
Main: Facility Form
Sub w/in tabctrl: multiple listing
Sub w/in tabctrls' tabcrl: Facility List
Field: ID

It looks like the same below but has an additional imbedded page (tbctrl)
Thanks, Melissa

Douglas J. Steele said:
Having the subforms on separate pages of a tab control doesn't change
anything.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Melissa said:
Steve,

How would you do this if you had pages with subforms within a form

Steve Schapel said:
Degul,

Thanks for the superb explanation.

[Child_ID]=[Forms]![frm_ParentInfo]![subfrm_Child].[Form]![Child_ID]

--
Steve Schapel, Microsoft Access MVP


Degul2000 wrote:
I have a form called frm_ParentInfo where I have information about the
parents of children who are taking certain classes. In this form, I
have the
parent's name
([Parent_Firstname_1],[Parent_Lastname_1],[Parent_Firstname_2],[Parent_Lastname_2]),
Address, telephone number, e-mail, etc.

In the Parent Info form, I have a subform (subfrm_Child) which has the
synopsis of another form (frm_ChildInfo). The subform shows only the
first
name of the child, the age, their gender, the class the child is
enrolled in.
These two forms (frm_ParentInfo and frm_ChildInfo) are linked by the
autonumbered key field in the parent form ([Parent_ID]). Unlike the
subform,
the main Child form (frm_ChildInfo) has detailed information about the
child-- a different address if they are not living in the same domicile
as
their parents, special learning/medical needs, etc.

From the main Parent form, I want to have the user be able to
double-click
on the child's first name on the subform (subfrm_Child) and have that
open
the main child form (frm_ChildInfo) so they can get detailed
information
about that child they have selected.

So in the subform, I have an event "on dbl click" called
"mac_EditChild."
This is an OpenForm which opens the form "frm_ChildInfo" in Form View
in Edit
Mode. My problem is the WHERE statement.
 

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