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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cmd Btn for reports

Status
Not open for further replies.

Danielle17

Technical User
Apr 17, 2001
102
US
I need some help on writing a bit of code for a command button...I need it pop up a report based on some criteria...First one of the fields has to say "Registered Lead"...I've got that part figured out...The next criteria is that the field "Date Entered" has to be equal to 6 months or back from the current date...so the report would have to include all records that have registered lead in the status field and the date that is in the Date Entered field needs to be say 2/9/01(6 months from today)...Here's the criteria statement that I've been trying to put in the query...

= "#" & me.txtDateHidden & "# = ([Customer and Lead Listing].[Date Entered]+ ("m", 6) "

the me.txtDateHidden is the textbox that displays the current date...Customer and Lead Listing is the name of the table...and the Date Entered is the field that I'm trying to find....

I'm trying to make this as simple as possible for the user...I just want them to have to click the command button and the query will run and the report will pop-up...should I re-think this :)
Thanks for any help anyone can give me...
 
I think this should do it for you:

= [DateEntered] < DateAdd(&quot;m&quot;,6, Date())
 
I think this should do it for you:

= [DateEntered] < DateAdd(&quot;m&quot;,6, Date())

It will test to see if the DateEntered is less than 6 months from todays date.
 
Oh, wait...I just noticed that it brings up all records that have &quot;Registered Lead&quot; in the status column....I still need it to do that but it has to just pull up the records 6 months back and further with RL in that column....now what?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top