E
E.Q.
We have a database used by maintenance personnel to record equipment issues
discovered during a predictive maintenance round. The techs enter info into
a form that has a subform; the source data for the main form comes from:
SELECT tblRoutLog.*, tblRoutes.chrBuildingNum
FROM tblRoutes INNER JOIN tblRoutLog ON tblRoutes.chrRouteID =
tblRoutLog.chrRout;
The subform (master field: idsRoute, Child Field chrRoute) has a combo box
whose row source is:
SELECT tblEquipment.[Equipment Number], tblEquipment.[Equipment Name]
FROM tblEquipment
WHERE (((InStr([tblEquipment]![Equipment
Number],[Forms]![frmRoutLog]![chrBuildingNum] & '-'))<>'0'));
This works fine for all routes contained in one building. Howerever,
they've added a route covering equipment from two buildings. Is there a way
to amend the SQL in either the main form or subform such that if the route
covers two buildings (in this case, chrRoute = "PM6110", but they could end
up adding others) such that two buildings are selected. (Currently the cbo
picks equipment only in bld 19 when the route covers both building 19 and
building 20.)
Thanks
EQC
discovered during a predictive maintenance round. The techs enter info into
a form that has a subform; the source data for the main form comes from:
SELECT tblRoutLog.*, tblRoutes.chrBuildingNum
FROM tblRoutes INNER JOIN tblRoutLog ON tblRoutes.chrRouteID =
tblRoutLog.chrRout;
The subform (master field: idsRoute, Child Field chrRoute) has a combo box
whose row source is:
SELECT tblEquipment.[Equipment Number], tblEquipment.[Equipment Name]
FROM tblEquipment
WHERE (((InStr([tblEquipment]![Equipment
Number],[Forms]![frmRoutLog]![chrBuildingNum] & '-'))<>'0'));
This works fine for all routes contained in one building. Howerever,
they've added a route covering equipment from two buildings. Is there a way
to amend the SQL in either the main form or subform such that if the route
covers two buildings (in this case, chrRoute = "PM6110", but they could end
up adding others) such that two buildings are selected. (Currently the cbo
picks equipment only in bld 19 when the route covers both building 19 and
building 20.)
Thanks
EQC