subform problem

  • Thread starter Thread starter NEOFYTOS
  • Start date Start date
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.
 
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
 
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.
 
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.
 
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.
 
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.
 
Back
Top