C
Chris W via AccessMonster.com
Hi all
I have a problem with integrating some code I received via a previous post
for linking a check box to a max.date function: this is the max date function
code: (note: this is only the WHERE statement from the SQL code as the full
code is very long and not all together necessary, when ever I put it in a
post it seems to scare people off)
WHERE (((Cost.[Date of Research])=(select max([Date of Research]) from cost
where cost.[Plant and Machinery ID]=Transaction.[Plant and Machinery ID])))
OR (((Cost.[Date of Research])=(select max([Date of Research]) from cost
where cost.[Plant and Machinery ID]=Transaction.[Plant and Machinery ID]))
OR [Forms]![FormName]![CheckBoxName] = True)
The problem that I am having now is that it fails to integrate with another
feature of the query, which is another check box ‘basket’. The function says
that when basket = TRUE (on the form) return only the records containing a
TRUE basket check box but when ‘basket’ on the form = false the query is to
return all records wether they contain a TRUE value or a FALSE.
My code as it is prior to the addition of the second checkbox is,
WHERE ((([forms]![multi query]![check60])=False) AND ((Cost.[Date of Research]
)=(select max([Date of Research]) from cost where cost.[Plant and Machinery
ID]=Transaction.[Plant and Machinery ID]))) OR (((Cost.[Date of Research])=
(select max([Date of Research]) from cost where cost.[Plant and Machinery ID]
=Transaction.[Plant and Machinery ID])) AND ((Transaction.Basket)=True))
So I need it to operate together when basket is selected only records where
basket=true are returned and when basket and the checkbox to disable max.
date function is true it returns all date for records where basket = true and
so on….for all the combinations of the two check box’s
I would dearly love to know how to integrate them to create a statement that
works, thanks for any help that you can offer I really appreciate it.
I have a problem with integrating some code I received via a previous post
for linking a check box to a max.date function: this is the max date function
code: (note: this is only the WHERE statement from the SQL code as the full
code is very long and not all together necessary, when ever I put it in a
post it seems to scare people off)
WHERE (((Cost.[Date of Research])=(select max([Date of Research]) from cost
where cost.[Plant and Machinery ID]=Transaction.[Plant and Machinery ID])))
OR (((Cost.[Date of Research])=(select max([Date of Research]) from cost
where cost.[Plant and Machinery ID]=Transaction.[Plant and Machinery ID]))
OR [Forms]![FormName]![CheckBoxName] = True)
The problem that I am having now is that it fails to integrate with another
feature of the query, which is another check box ‘basket’. The function says
that when basket = TRUE (on the form) return only the records containing a
TRUE basket check box but when ‘basket’ on the form = false the query is to
return all records wether they contain a TRUE value or a FALSE.
My code as it is prior to the addition of the second checkbox is,
WHERE ((([forms]![multi query]![check60])=False) AND ((Cost.[Date of Research]
)=(select max([Date of Research]) from cost where cost.[Plant and Machinery
ID]=Transaction.[Plant and Machinery ID]))) OR (((Cost.[Date of Research])=
(select max([Date of Research]) from cost where cost.[Plant and Machinery ID]
=Transaction.[Plant and Machinery ID])) AND ((Transaction.Basket)=True))
So I need it to operate together when basket is selected only records where
basket=true are returned and when basket and the checkbox to disable max.
date function is true it returns all date for records where basket = true and
so on….for all the combinations of the two check box’s
I would dearly love to know how to integrate them to create a statement that
works, thanks for any help that you can offer I really appreciate it.