Conditional Removal from another statement (1 Viewer)

Adrianna

Registered User.
Local time
Today, 06:02
Joined
Oct 16, 2000
Messages
254
Okay...

I have a field that Checks whether or not a certain situation needs evaluation.
If the evaluation is not needed, then the related DATE field becomes irrelevant, so DATE.visible = False blah...blah

The problem starts here.....

All of the feilds on this one form are relevant to the over all project status. As certain fields are filled in, the ProjectStatus automatically updates.

Well.....
If the field is set visible and required...there is no problem....I just check if it is null or not.

If the field is not visible....then the user can not change the contents (there would be no need), but then I have no way of removing the field from the ProjectStatus criteria.

I've considered just setting DATE = #12/12/20# ......but this won't work well for data integrity.
 

glynch

Registered User.
Local time
Today, 06:02
Joined
Dec 20, 2001
Messages
128
a neat little trick I learned once may help you out. This question is posted in the VBA section but maybe you can use this query idea somehow. You can put an immediate If statement as both the field entry and criteria entry in the same field of a query.

In the field value enter something like:

Status:Iif(IsNull(forms!myform!date),1,forms!myform!date)

Then in the criteria for the same field:

Iif(IsNull(forms!myform!date),1,Date())

This will compare the date entered with today's date, but if the date field is null, it will see that 1 = 1 and ignore this field as a criterion. If this field is one of many criteria, this will get the query to ignore the need to meet this criterion.

Your question is different but you may be able to use the idea to ignore your irrelevant date field. Good luck.

HTH
 

Jon K

Registered User.
Local time
Today, 11:02
Joined
May 22, 2002
Messages
2,209
"If the field is not visible...... I have no way of removing the field from the ProjectStatus criteria."


Removing the Date field from the criteria is equivalent to returning every record as far as the Date field is concerned.

Setting [Date]=[Date] will return every record excluding those with null dates.

Setting ([Date]=[Date] or isnull([Date])) will return every record including those with null dates.

Hope this helps.
 

Users who are viewing this thread

Top Bottom