Refering to a Form & Subform in a combo box command in sub form

  • Thread starter Thread starter chez
  • Start date Start date
C

chez

I have a Parent Form
Within this form is a sub form
Within the sub form is a combo command

When I open the sub form on it's own, the command works fine
When I attempt to open using the Parent Form, I have an error 'enter
parameter value' and it shows me my combo box code (which doesn't refer to
the Parent form I want to use it in) and that is because I don't remember how
to write that (it's been a long time since I've used Access)

An example of my code:
SELECT [maintain category].Cat2ID, [maintain category].Cat1ID FROM [maintain
category] GROUP BY [maintain category].Cat2ID, [maintain category].Cat1ID
HAVING ((([maintain
category].Cat1ID)=forms!frmClassAttendance_Subform.tbClasses_class));

Hope someone can help
Cheers
Cheryl
 
Hi chez,
try something like this

forms!yourparentformname!frmClassAttendance_Subform.tbClasses_class

HTH Paolo
 
I tried as suggested, and still not working (same error message), I"ve
replced (!) with (.) and switched the form names around, I've double checked
all spelling, I've added a refresh action after the 1st update in the subform
(because the first is just data entry and works fine), then the second field
is the combo...arrrrrggghhh

Any other suggestions !

Paolo said:
Hi chez,
try something like this

forms!yourparentformname!frmClassAttendance_Subform.tbClasses_class

HTH Paolo

chez said:
I have a Parent Form
Within this form is a sub form
Within the sub form is a combo command

When I open the sub form on it's own, the command works fine
When I attempt to open using the Parent Form, I have an error 'enter
parameter value' and it shows me my combo box code (which doesn't refer to
the Parent form I want to use it in) and that is because I don't remember how
to write that (it's been a long time since I've used Access)

An example of my code:
SELECT [maintain category].Cat2ID, [maintain category].Cat1ID FROM [maintain
category] GROUP BY [maintain category].Cat2ID, [maintain category].Cat1ID
HAVING ((([maintain
category].Cat1ID)=forms!frmClassAttendance_Subform.tbClasses_class));

Hope someone can help
Cheers
Cheryl
 
Which event trigger the code that raises the error?
tbClasses_class has a default value?
Actually if you use it in a SQL instruction it must contain a value,
otherwise access ask for it and it could be what happens to you.

Cheers Paolo

chez said:
I tried as suggested, and still not working (same error message), I"ve
replced (!) with (.) and switched the form names around, I've double checked
all spelling, I've added a refresh action after the 1st update in the subform
(because the first is just data entry and works fine), then the second field
is the combo...arrrrrggghhh

Any other suggestions !

Paolo said:
Hi chez,
try something like this

forms!yourparentformname!frmClassAttendance_Subform.tbClasses_class

HTH Paolo

chez said:
I have a Parent Form
Within this form is a sub form
Within the sub form is a combo command

When I open the sub form on it's own, the command works fine
When I attempt to open using the Parent Form, I have an error 'enter
parameter value' and it shows me my combo box code (which doesn't refer to
the Parent form I want to use it in) and that is because I don't remember how
to write that (it's been a long time since I've used Access)

An example of my code:
SELECT [maintain category].Cat2ID, [maintain category].Cat1ID FROM [maintain
category] GROUP BY [maintain category].Cat2ID, [maintain category].Cat1ID
HAVING ((([maintain
category].Cat1ID)=forms!frmClassAttendance_Subform.tbClasses_class));

Hope someone can help
Cheers
Cheryl
 
Each combo box has a similar code to the one shown, just with the extra
field names added. As I mentioned before, when in the subform alone and
referring only to the subform, works perfectly.
Just when I place into the parent form, I am unable to call properly (error
message 'enter parameter value')
If worse comes to worse, I will take the longer method, just a
shame....there must be a way, but I'm not really familiar with sql. I wish I
could send you a mini example, but thats not allowed ....is it ?

The default values are just 'n/a'

Any other ideas, please let me know
Cheers
Chez

Paolo said:
Which event trigger the code that raises the error?
tbClasses_class has a default value?
Actually if you use it in a SQL instruction it must contain a value,
otherwise access ask for it and it could be what happens to you.

Cheers Paolo

chez said:
I tried as suggested, and still not working (same error message), I"ve
replced (!) with (.) and switched the form names around, I've double checked
all spelling, I've added a refresh action after the 1st update in the subform
(because the first is just data entry and works fine), then the second field
is the combo...arrrrrggghhh

Any other suggestions !

Paolo said:
Hi chez,
try something like this

forms!yourparentformname!frmClassAttendance_Subform.tbClasses_class

HTH Paolo

:

I have a Parent Form
Within this form is a sub form
Within the sub form is a combo command

When I open the sub form on it's own, the command works fine
When I attempt to open using the Parent Form, I have an error 'enter
parameter value' and it shows me my combo box code (which doesn't refer to
the Parent form I want to use it in) and that is because I don't remember how
to write that (it's been a long time since I've used Access)

An example of my code:
SELECT [maintain category].Cat2ID, [maintain category].Cat1ID FROM [maintain
category] GROUP BY [maintain category].Cat2ID, [maintain category].Cat1ID
HAVING ((([maintain
category].Cat1ID)=forms!frmClassAttendance_Subform.tbClasses_class));

Hope someone can help
Cheers
Cheryl
 
Try this
forms!yourparentformname!frmClassAttendance_Subform.form!tbClasses_class

What's tbClasses_class, the combo or something else?
The select instruction is in a button?
Explain me what you are trying to do step by step so I can understand.

chez said:
Each combo box has a similar code to the one shown, just with the extra
field names added. As I mentioned before, when in the subform alone and
referring only to the subform, works perfectly.
Just when I place into the parent form, I am unable to call properly (error
message 'enter parameter value')
If worse comes to worse, I will take the longer method, just a
shame....there must be a way, but I'm not really familiar with sql. I wish I
could send you a mini example, but thats not allowed ....is it ?

The default values are just 'n/a'

Any other ideas, please let me know
Cheers
Chez

Paolo said:
Which event trigger the code that raises the error?
tbClasses_class has a default value?
Actually if you use it in a SQL instruction it must contain a value,
otherwise access ask for it and it could be what happens to you.

Cheers Paolo

chez said:
I tried as suggested, and still not working (same error message), I"ve
replced (!) with (.) and switched the form names around, I've double checked
all spelling, I've added a refresh action after the 1st update in the subform
(because the first is just data entry and works fine), then the second field
is the combo...arrrrrggghhh

Any other suggestions !

:

Hi chez,
try something like this

forms!yourparentformname!frmClassAttendance_Subform.tbClasses_class

HTH Paolo

:

I have a Parent Form
Within this form is a sub form
Within the sub form is a combo command

When I open the sub form on it's own, the command works fine
When I attempt to open using the Parent Form, I have an error 'enter
parameter value' and it shows me my combo box code (which doesn't refer to
the Parent form I want to use it in) and that is because I don't remember how
to write that (it's been a long time since I've used Access)

An example of my code:
SELECT [maintain category].Cat2ID, [maintain category].Cat1ID FROM [maintain
category] GROUP BY [maintain category].Cat2ID, [maintain category].Cat1ID
HAVING ((([maintain
category].Cat1ID)=forms!frmClassAttendance_Subform.tbClasses_class));

Hope someone can help
Cheers
Cheryl
 
Hi again, I've used a screen dump to describe, please view at my webpage
www.ksstest.com.au
Thanx Chez

Paolo said:
Try this
forms!yourparentformname!frmClassAttendance_Subform.form!tbClasses_class

What's tbClasses_class, the combo or something else?
The select instruction is in a button?
Explain me what you are trying to do step by step so I can understand.

chez said:
Each combo box has a similar code to the one shown, just with the extra
field names added. As I mentioned before, when in the subform alone and
referring only to the subform, works perfectly.
Just when I place into the parent form, I am unable to call properly (error
message 'enter parameter value')
If worse comes to worse, I will take the longer method, just a
shame....there must be a way, but I'm not really familiar with sql. I wish I
could send you a mini example, but thats not allowed ....is it ?

The default values are just 'n/a'

Any other ideas, please let me know
Cheers
Chez

Paolo said:
Which event trigger the code that raises the error?
tbClasses_class has a default value?
Actually if you use it in a SQL instruction it must contain a value,
otherwise access ask for it and it could be what happens to you.

Cheers Paolo

:

I tried as suggested, and still not working (same error message), I"ve
replced (!) with (.) and switched the form names around, I've double checked
all spelling, I've added a refresh action after the 1st update in the subform
(because the first is just data entry and works fine), then the second field
is the combo...arrrrrggghhh

Any other suggestions !

:

Hi chez,
try something like this

forms!yourparentformname!frmClassAttendance_Subform.tbClasses_class

HTH Paolo

:

I have a Parent Form
Within this form is a sub form
Within the sub form is a combo command

When I open the sub form on it's own, the command works fine
When I attempt to open using the Parent Form, I have an error 'enter
parameter value' and it shows me my combo box code (which doesn't refer to
the Parent form I want to use it in) and that is because I don't remember how
to write that (it's been a long time since I've used Access)

An example of my code:
SELECT [maintain category].Cat2ID, [maintain category].Cat1ID FROM [maintain
category] GROUP BY [maintain category].Cat2ID, [maintain category].Cat1ID
HAVING ((([maintain
category].Cat1ID)=forms!frmClassAttendance_Subform.tbClasses_class));

Hope someone can help
Cheers
Cheryl
 
Hullo chez,
I saw your screen dump and I think you inverted the order of form and
subform in your condition.
try with

forms!frmclassattendance!frmclassattendance_subform.form!tbclasses_class

HTH Paolo


chez said:
Hi again, I've used a screen dump to describe, please view at my webpage
www.ksstest.com.au
Thanx Chez

Paolo said:
Try this
forms!yourparentformname!frmClassAttendance_Subform.form!tbClasses_class

What's tbClasses_class, the combo or something else?
The select instruction is in a button?
Explain me what you are trying to do step by step so I can understand.

chez said:
Each combo box has a similar code to the one shown, just with the extra
field names added. As I mentioned before, when in the subform alone and
referring only to the subform, works perfectly.
Just when I place into the parent form, I am unable to call properly (error
message 'enter parameter value')
If worse comes to worse, I will take the longer method, just a
shame....there must be a way, but I'm not really familiar with sql. I wish I
could send you a mini example, but thats not allowed ....is it ?

The default values are just 'n/a'

Any other ideas, please let me know
Cheers
Chez

:

Which event trigger the code that raises the error?
tbClasses_class has a default value?
Actually if you use it in a SQL instruction it must contain a value,
otherwise access ask for it and it could be what happens to you.

Cheers Paolo

:

I tried as suggested, and still not working (same error message), I"ve
replced (!) with (.) and switched the form names around, I've double checked
all spelling, I've added a refresh action after the 1st update in the subform
(because the first is just data entry and works fine), then the second field
is the combo...arrrrrggghhh

Any other suggestions !

:

Hi chez,
try something like this

forms!yourparentformname!frmClassAttendance_Subform.tbClasses_class

HTH Paolo

:

I have a Parent Form
Within this form is a sub form
Within the sub form is a combo command

When I open the sub form on it's own, the command works fine
When I attempt to open using the Parent Form, I have an error 'enter
parameter value' and it shows me my combo box code (which doesn't refer to
the Parent form I want to use it in) and that is because I don't remember how
to write that (it's been a long time since I've used Access)

An example of my code:
SELECT [maintain category].Cat2ID, [maintain category].Cat1ID FROM [maintain
category] GROUP BY [maintain category].Cat2ID, [maintain category].Cat1ID
HAVING ((([maintain
category].Cat1ID)=forms!frmClassAttendance_Subform.tbClasses_class));

Hope someone can help
Cheers
Cheryl
 
FANTASTIC !!!!
You don't know how happy I am, thank you for taking the time to read through
my efforts .... Your a Champ !!

Paolo said:
Hullo chez,
I saw your screen dump and I think you inverted the order of form and
subform in your condition.
try with

forms!frmclassattendance!frmclassattendance_subform.form!tbclasses_class

HTH Paolo


chez said:
Hi again, I've used a screen dump to describe, please view at my webpage
www.ksstest.com.au
Thanx Chez

Paolo said:
Try this
forms!yourparentformname!frmClassAttendance_Subform.form!tbClasses_class

What's tbClasses_class, the combo or something else?
The select instruction is in a button?
Explain me what you are trying to do step by step so I can understand.

:


Each combo box has a similar code to the one shown, just with the extra
field names added. As I mentioned before, when in the subform alone and
referring only to the subform, works perfectly.
Just when I place into the parent form, I am unable to call properly (error
message 'enter parameter value')
If worse comes to worse, I will take the longer method, just a
shame....there must be a way, but I'm not really familiar with sql. I wish I
could send you a mini example, but thats not allowed ....is it ?

The default values are just 'n/a'

Any other ideas, please let me know
Cheers
Chez

:

Which event trigger the code that raises the error?
tbClasses_class has a default value?
Actually if you use it in a SQL instruction it must contain a value,
otherwise access ask for it and it could be what happens to you.

Cheers Paolo

:

I tried as suggested, and still not working (same error message), I"ve
replced (!) with (.) and switched the form names around, I've double checked
all spelling, I've added a refresh action after the 1st update in the subform
(because the first is just data entry and works fine), then the second field
is the combo...arrrrrggghhh

Any other suggestions !

:

Hi chez,
try something like this

forms!yourparentformname!frmClassAttendance_Subform.tbClasses_class

HTH Paolo

:

I have a Parent Form
Within this form is a sub form
Within the sub form is a combo command

When I open the sub form on it's own, the command works fine
When I attempt to open using the Parent Form, I have an error 'enter
parameter value' and it shows me my combo box code (which doesn't refer to
the Parent form I want to use it in) and that is because I don't remember how
to write that (it's been a long time since I've used Access)

An example of my code:
SELECT [maintain category].Cat2ID, [maintain category].Cat1ID FROM [maintain
category] GROUP BY [maintain category].Cat2ID, [maintain category].Cat1ID
HAVING ((([maintain
category].Cat1ID)=forms!frmClassAttendance_Subform.tbClasses_class));

Hope someone can help
Cheers
Cheryl
 
Back
Top