Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Possible IIf function
John Muir 
     
5 years ago
In a form based on a query, i want a date field, [DocumentsDiary], to either populate if currently null or change if an existing date is in the field by + 7days, based on the selection of "POST-SETTLEMENT DOCUMENTS" from a field called [CasePhase].

So when i select "POST-SETTLEMENT DOCUMENTS" from a combo box i want the existing date field to increase by 7 days.

Thanks,

John
Adam Schwanz  @Reply  
           
5 years ago
Sorry I have a hard time following along what you're trying to do with all the field names that mean nothing to me.

So in general, not sure what you want to do if documentsdairy is null, so I just threw the current date in

IIF(IsNull(DocumentsDiary),Date(),DocumentsDiary+7)

For the second part, you just want to have an afterupdate event that sets the date.

If Date() - DocumentsDiary <= 7 Then ' something to catch so can't spam the date up if you change the combo box on accident
'do nothing
Else
  DocumentsDiary = DocumentsDiary + 7
End if
John Muir OP  @Reply  
     
5 years ago
Sorry my question wasn't clear.

For the [casephase] field, I have a combo box where I can select the phase such as Case Intake. When I change that field to "Post Settlement Documents" to populate the [CasePhase] field from the Combo Box, I want the [DocumentsDiary] date field to be seven days in the future or seven days from today.

Something like if the CasePhase is currently "Case Intake" and today i change to "Post-Settlement Documents" i want the DocumentsDiary date field to show 8/23/2021.

Here is the combo box row source for [CasePhase]: "POST-SETTLEMENT DOCUMENTS";"INTAKE AND PREPARATION";"NEGOTIATIONS";"NEGOTIATIONS - SUSPENDED";"AWAITING POLICY ISSUANCE";"CLOSE CASE"

Does my question make sense?

Thanks,

John





When the
Kevin Robertson  @Reply  
          
5 years ago
Is this what you need? Add to AfterUpdate Event for your ComboBox.

   If CasePhase = "POST-SETTLEMENT DOCUMENTS" Then
      If IsNull(DocumentsDiary) Or DocumentDiary = "" Then
         DocumentsDiary = Date() + 7
      Else
         DocumentsDiary = DocumentsDiary + 7
      End If
   End If
Adam Schwanz  @Reply  
           
5 years ago
Ah, yea what Kevin has there should work.

Depending on how you use things I would probably still add a catch in there like I had (or similar, million ways you could do it) so if you set it to post-settlement documents, and then come back to it a few days later and accidentally change that combo box or re-set it back to post-settlement documents you don't end up adding 7 more additional days to it.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 7:42:16 AM. PLT: 1s