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

Adding a checkbox in a query that populates based on another field?

Status
Not open for further replies.

Tiredmom

MIS
May 18, 1999
9
US
I have set up a query using multiple criteria. I am tracking (for our recruitment area) how many positions are open, how many were posted in the last week and how many were filled in the last week. I have all this data in a query but I would like to delineate those positions that are over a week old. I was wondering if I can add a field that will populate (perhaps a checkbox?)if the position was posted more than one week ago. I am in the dark on this though so any help would be appreciated!
 
I don't know if this will help, but a simple solution is to take the results of your query as a source for a second query, and in your date field (I assume there is one) with a criteria <=Now() - 7. This should return any results that meet your criteria of your first query, and take into account anything older than 7 days from today.
I am sure there is a sleeker sexier way to do this in vba, but I can't tell you, as I have no clue.
 
Thank you for responding. I do have the date criteria built in. I just am looking for a way to differentiate the &quot;older&quot; postings from the newer ones. I want to be able to set up a report that will set aside the older postings, that's why I was wondering about a check box.
 
Building on the above, you could just create a whole new query, and base your report solely on that query. Using the criteria specified &quot;<=Now() -7&quot;, this will only display anything older than a week. This will give you one query with all of your positions listed, and the second query will only display those listed a week (or more) ago. I assume you have some way of identifying if the position is still active (a check box or yes/no field). If you include that field in your query, and set the criteria equal to yes (-1, whatever) then that will only display active listings, that are a week or older.
Does this help??? Maybe not the solution you're looking for.
 
I am trying to create a select query, I want the criteria to be filled by getting the value from a function. How can I accomplish this please?
 
That is a little beyond me, depending on what the function is, and where it stores it's value. You might try reposting the question in the main forum, more people with far greater vba knowledge can probably provide an answer for you. Sorry. Anyway you can set the function in your criteria field of your query?
 
No, I am having trouble doing so. Thank you so much for your help though! I appreciate it greatly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top