subform problem

N

NEOFYTOS

hello
i have a database with a main and subform
i tried first to put a check box in the main form in order to apply some
criteria using two fields in the main form.
=IIf([EdafoponikiMorfi]=8 And [EdafoponikiDescription] Is Null;"NO";"OK")
this code in the first check box work properly.(the two fields are in the
main form.

My problem now is to make the same job with two fields that the one is on
the main form and the second in a subform.
i give the following code.

=IIf([StandOrigin]=2 And [F_TexnitiRecords subform].[Form]![TexnitiId] Is
Null;"no";"ok")

when i tried to use the above code i do not get the expected result.


I am waiting for any help
Neofytos

Thank you in advance.
 
P

Paolo

Hi NEOFYTOS,
=IIf([StandOrigin]=2 And forms![name of the form containing the
subform]![F_TexnitiRecords subform].[Form]![TexnitiId] Is Null;"no";"ok")

substitute [name of the form containing the subform] with the correct name.
I prefer to use is null(argument) but it work also in the way you use it.

HTH Paolo
 
K

Klatuu

No, the Is Null only works in SQL.
In VBA when referring to controls on the form, it has to be IsNull()
--
Dave Hargis, Microsoft Access MVP


Paolo said:
Hi NEOFYTOS,
=IIf([StandOrigin]=2 And forms![name of the form containing the
subform]![F_TexnitiRecords subform].[Form]![TexnitiId] Is Null;"no";"ok")

substitute [name of the form containing the subform] with the correct name.
I prefer to use is null(argument) but it work also in the way you use it.

HTH Paolo

NEOFYTOS said:
hello
i have a database with a main and subform
i tried first to put a check box in the main form in order to apply some
criteria using two fields in the main form.
=IIf([EdafoponikiMorfi]=8 And [EdafoponikiDescription] Is Null;"NO";"OK")
this code in the first check box work properly.(the two fields are in the
main form.

My problem now is to make the same job with two fields that the one is on
the main form and the second in a subform.
i give the following code.

=IIf([StandOrigin]=2 And [F_TexnitiRecords subform].[Form]![TexnitiId] Is
Null;"no";"ok")

when i tried to use the above code i do not get the expected result.


I am waiting for any help
Neofytos

Thank you in advance.
 
P

Paolo

Thanks for the correction Klatuu, I put an extra space. Sometimes my fingers
are quicker than my brain...

Klatuu said:
No, the Is Null only works in SQL.
In VBA when referring to controls on the form, it has to be IsNull()
--
Dave Hargis, Microsoft Access MVP


Paolo said:
Hi NEOFYTOS,
=IIf([StandOrigin]=2 And forms![name of the form containing the
subform]![F_TexnitiRecords subform].[Form]![TexnitiId] Is Null;"no";"ok")

substitute [name of the form containing the subform] with the correct name.
I prefer to use is null(argument) but it work also in the way you use it.

HTH Paolo

NEOFYTOS said:
hello
i have a database with a main and subform
i tried first to put a check box in the main form in order to apply some
criteria using two fields in the main form.
=IIf([EdafoponikiMorfi]=8 And [EdafoponikiDescription] Is Null;"NO";"OK")
this code in the first check box work properly.(the two fields are in the
main form.

My problem now is to make the same job with two fields that the one is on
the main form and the second in a subform.
i give the following code.

=IIf([StandOrigin]=2 And [F_TexnitiRecords subform].[Form]![TexnitiId] Is
Null;"no";"ok")

when i tried to use the above code i do not get the expected result.


I am waiting for any help
Neofytos

Thank you in advance.
 
K

Klatuu

Almost anything is quicker than my brain :)
--
Dave Hargis, Microsoft Access MVP


Paolo said:
Thanks for the correction Klatuu, I put an extra space. Sometimes my fingers
are quicker than my brain...

Klatuu said:
No, the Is Null only works in SQL.
In VBA when referring to controls on the form, it has to be IsNull()
--
Dave Hargis, Microsoft Access MVP


Paolo said:
Hi NEOFYTOS,
=IIf([StandOrigin]=2 And forms![name of the form containing the
subform]![F_TexnitiRecords subform].[Form]![TexnitiId] Is Null;"no";"ok")

substitute [name of the form containing the subform] with the correct name.
I prefer to use is null(argument) but it work also in the way you use it.

HTH Paolo

:

hello
i have a database with a main and subform
i tried first to put a check box in the main form in order to apply some
criteria using two fields in the main form.
=IIf([EdafoponikiMorfi]=8 And [EdafoponikiDescription] Is Null;"NO";"OK")
this code in the first check box work properly.(the two fields are in the
main form.

My problem now is to make the same job with two fields that the one is on
the main form and the second in a subform.
i give the following code.

=IIf([StandOrigin]=2 And [F_TexnitiRecords subform].[Form]![TexnitiId] Is
Null;"no";"ok")

when i tried to use the above code i do not get the expected result.


I am waiting for any help
Neofytos

Thank you in advance.
 
N

NEOFYTOS

thank you
your advise was very helpfull
--
THANK YOU


Klatuu said:
No, the Is Null only works in SQL.
In VBA when referring to controls on the form, it has to be IsNull()
--
Dave Hargis, Microsoft Access MVP


Paolo said:
Hi NEOFYTOS,
=IIf([StandOrigin]=2 And forms![name of the form containing the
subform]![F_TexnitiRecords subform].[Form]![TexnitiId] Is Null;"no";"ok")

substitute [name of the form containing the subform] with the correct name.
I prefer to use is null(argument) but it work also in the way you use it.

HTH Paolo

NEOFYTOS said:
hello
i have a database with a main and subform
i tried first to put a check box in the main form in order to apply some
criteria using two fields in the main form.
=IIf([EdafoponikiMorfi]=8 And [EdafoponikiDescription] Is Null;"NO";"OK")
this code in the first check box work properly.(the two fields are in the
main form.

My problem now is to make the same job with two fields that the one is on
the main form and the second in a subform.
i give the following code.

=IIf([StandOrigin]=2 And [F_TexnitiRecords subform].[Form]![TexnitiId] Is
Null;"no";"ok")

when i tried to use the above code i do not get the expected result.


I am waiting for any help
Neofytos

Thank you in advance.
 

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