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!

Access 97 help? 1

Status
Not open for further replies.

hereigns

MIS
Sep 17, 2002
172
US
Novice user seeking help with Access 97

Database has a table (tblDriver) that I would like to build a Query (or whatever will work) that will automatically fill in a particular field (insurancestatus) with a "pass or fail" record depending on whether or not a particular field (insurance expiration) is past the current date.

I'm not really certain on the best way to accomplish this task - possible a If Then Else statement? If so, any ideas on how I go about setting it up? Help???
 
An update query should work.
In the Update To box of the insurancestatus field put

=IIF([insurance expiration]>Date(),"Fail","Pass")

Ken
 
Ken,
Thanks for the input but I'm a little confused...

Do I need to build a query in order follow your suggestion? Where will I find the "Update To" box?

Sorry I'm not understanding your suggestion.
 
Start a new query. On the tool bar at the top, just to the left of the run (!) button, is the query type button. Click on the pull down menu and select update query. This will add the "Update To" field in the design view. Put kewo99's code, =IIF([insurance expiration]>Date(),"Fail","Pass") , (without the leading and following commas).

----
A program is a spell cast over a computer, turning input into error messages.
 
dcurtis,
Thanks for the help! After adding the query and running it - it added the text "Fail" to ALL of the status records. It looks like I'm missing some other parameter to tell it if the date is before the current date then add "Fail" to the record otherwise add the text "Pass".
 
Ok, looking back at it, I think your code should say:

Code:
=IIF([insurance expiration]<Date(),&quot;Fail&quot;,&quot;Pass&quot;)

Change the direction of the &quot;carat&quot; from greater than to less than. That should do it.

----
A program is a spell cast over a computer, turning input into error messages.
 
Hi rlivermore,

If all records are updating to the same thing (Pass or Fail), then the comparison of the current date to the datefield (insurance expiration) is not working correctly.
Make sure that insurance expiration is a date/time data type field and not a text field.

Ken
 
Ken & dcurtis,

Thank you both VERY MUCH for your assistance and persistance! Both of your replies solved the problem! You guys ROCK!

God Bless,
Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top