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!

Hi, I have a form which I let th

Status
Not open for further replies.

Dre313

Technical User
Jun 4, 2003
219
US
Hi,

I have a form which I let the user enter in data, each group of data is stored as a inspection. Everytime an inspection is created, the current date is assigned to each inspection.

I also made another form to let the user update any inspection they choose. In this update form the user can enter in another date, a close date. To close off the inspection after the inspection is done.

So now each inspection can has two dates. An open date to let the user know when the inspection was created and closing date - to close off the inspection after someone has completed that imspection.

My problem is:

I built another form which seaches for these inspections..
On my Form I have:

Search for
----------

open inspections: [begindate1] thru [enddate2]
closed inspections: [begindate3] thru [enddate4]

[cmd button]

Here if the user wants to see all opened inspections, then they would fill in the dates to fields: begin date1 and end date2.. hit the cmd button and this would pull up all opened inspections.. same goes for all closed inspections.

I'm using a query to search for these records. This would be in my criteria of the open inspection field: "frm_reportQualityStatus" is my search form
Code:
Between [Forms]![frm_reportQualityStatus]![begindate1] And [Forms]![frm_reportQualityStatus]![enddate2]
This works fine.

What I do now is copy the same piece of code as on top and changed my field names and insert this in the criteria of the closed inspection field:
Code:
Between [Forms]![frm_reportQualityStatus]![begindate3] And [Forms]![frm_reportQualityStatus]![enddate4]

Now I go back to my seach form and try to find all closed inspections. I enter in dates to search for closed inspections. ( leaving the open dates field blank ) hit enter and no records come up. So I take off the dates in my closed inspection fields and just try to do a search of all opened inspection. To my surprise none are pulled up this time.

So my question is why is this doing this? When I pull up all closed inspections. There should be listed dates when the inspection was open and closed.

any ideas ? thanks
 
You need to make two different queris and one form with the wame filed names. Unless you had put the criterias in the form on a different line to make and OR statement instead of an AND statement. If this is the case email me back and I will helo you write the code.

Rick Smith
703-248-7842
rsmith@litsllc.com

Network Security( CCNA, CISSP)
Sell Shopping Cart/Merchant Account
Access Expert
rsmith@litsllc.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top