Hello All,
I have a form which has 6 location fields. When values are selected in any combination of these fields (for example, building, floor, and room have values selected but zone, subroom, and cube do not), the query will pull the row in the table which matches the selections and populate the form.
My problem occurs when all 6 are not utilized. In the above example, the correct value will be returned as well as those rows which have values for the fields which are null (not selected).
The code in the condition line of the query is the following (only supplying the line for subroomNumber and not for the other five options):
Like Forms![WSM Edit/Add Space].[tab2subroomnumber] or Like Forms![WSM Edit/Add Space].[tab2subroomnumber] is null
I then modified the criteria line to the following:
IIF(isnull(Forms![WSM Edit/Add Space].[tab2subroomnumber]),null,Forms![WSM Edit/Add Space].[tab2subroomnumber])
Which, will return the correct value when all selections are made but will return nothing when the subroomnumber field has been left blank (is null).
I have tried many many combinations and so am now turning for help. Any ideas?
Thanks,
Calvin
I have a form which has 6 location fields. When values are selected in any combination of these fields (for example, building, floor, and room have values selected but zone, subroom, and cube do not), the query will pull the row in the table which matches the selections and populate the form.
My problem occurs when all 6 are not utilized. In the above example, the correct value will be returned as well as those rows which have values for the fields which are null (not selected).
The code in the condition line of the query is the following (only supplying the line for subroomNumber and not for the other five options):
Like Forms![WSM Edit/Add Space].[tab2subroomnumber] or Like Forms![WSM Edit/Add Space].[tab2subroomnumber] is null
I then modified the criteria line to the following:
IIF(isnull(Forms![WSM Edit/Add Space].[tab2subroomnumber]),null,Forms![WSM Edit/Add Space].[tab2subroomnumber])
Which, will return the correct value when all selections are made but will return nothing when the subroomnumber field has been left blank (is null).
I have tried many many combinations and so am now turning for help. Any ideas?
Thanks,
Calvin
Last edited: