Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is wrong with this piece of code???

Status
Not open for further replies.

allcarfan

Programmer
Jan 29, 2003
33
0
0
US
I am, again, using a Query By Form technique.

IIf([Main Tracking Table]![Date of Action] Is Null,[Main Tracking Table]![Sent to Field]+30 Between Date() And Date()+[Forms]![form1]![Days])

Date of action and sent to field are dates. [Days] is a textbox on form1. I dont get any kind of error when i run this code, but it is not returning any records, and it should.

This is what i want it to do:

If the date of action field is null, then the sent to field date +30 must fall between the current date and the current date + the value I input in the Days textbox.

The macro is running correctly. The QBF function is working properly...its just not returning any records and i know that there are records that meet this criteria.
 
Figured it out. Rather than writing such a long piece of code, I inserted the field 'sent to field' into the query and put its criteria as null. The query defaulted and created another expresssion. Works like a charm. bare with me, im new at this!
 
Try IIf(IsNull([Main Tracking Table]![Date of Action])...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top