set value of checkbox based on a query

czejny

New member
Local time
Today, 20:55
Joined
Mar 13, 2009
Messages
6
hello
i have a db as follows - simplified:

tables:

equipment_machine

  • ID
  • description
equipment_part

  • ID
  • machine (FK: equipment_machine.ID)
  • description
equipment_modification

  • task
  • on part (FK: equipment_part.ID)
  • class (automation, functional, hygienic)

relations:
machine 1:1-n part
part 1:0-n modifications

then i have 2 reports:
equipment register - where all machines with their parts are listed in full detail
modifications - where only parts with their modifs ina table are listed

now i would like to add 3 checkboxes to the equipment register report that are TRUE when the respective part has modifications of either of the 3 classes automation, functional, hygienic

my approach so far is the following:
i made a query "CheckForModif"
SELECT Equipment_Modifications.Task, Equipment_Modifications.Class.Value, Equipment_Modifications.[On Part]
FROM Equipment_Modifications;

then in the detail section of the report i add a checkbox and tried with the following

=(SELECT Task FROM CheckForModif WHERE (((Class.Value)="Hygiene") AND (([On Part])=Equipment_Part.ID)); is not null)

but the checkbox remains greyed out
i have tested the query in the satement as a normal query and its going to ask me for Equipment_Part.ID
if i enter any valid number it works just fine
the ID is avaliable in the report i have tested that with a normal textbox =(ID) prints fine too

is there a problem with the scope of ID as in not beeing avaliable in above statement?

or does anybody have another approach?
 

Users who are viewing this thread

Back
Top Bottom