Coding to automatically enter date depending on another field result (1 Viewer)

Milnerm

New member
Local time
Today, 05:01
Joined
Jun 23, 2017
Messages
6
Hi

Hope someone can help me with this.

I've been asked to add some verification fields to one of the databases. I've tried different coding but not quite what I need.

I need to do the following:

1. Create a checkbox to confirm the record requires a review at a future date - DONE

2. Automatically enter the review due date based on - if the checkbox is checked the review due date = another field date plus 182 days....this is what I need help with please.

Do I enter a formula at the table level or in an event field on the form? What coding should I enter?

Thanks in advance for your help
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 01:01
Joined
Apr 27, 2015
Messages
6,286
Hello again Michelle!

You are on the right track as far as using an unbound form field rather than using a table field.

I would use the form's oncurrent event.

Code:
IF Me.chkBox = True And Me.ReviewDate <> "" Then
     Me.unBoundDateField = Me.ReviewDate + 182
End IF

I am shooting from the hip on this one and have not tested this code, but you can tweak it as needed. Hopefully this will get you pointed in the right direction!
 

Milnerm

New member
Local time
Today, 05:01
Joined
Jun 23, 2017
Messages
6
Hi thank you...will try this on Monday when I'm back in the office
 

Milnerm

New member
Local time
Today, 05:01
Joined
Jun 23, 2017
Messages
6
Unfortunately this didn't work....I need to enter code to do the following:

When a User checks a checkbox (6 Month Review Required), the Review Due Date should automatically populate based on the calculation Actual Corrective Action Date (date/time field) plus 182 days. If a 6 month review is not required then the Review Due Date should remain empty.

I've tried various coding now and am really stuck because although the coding I've entered is accepted the Review Due Date is remaining empty despite the checkbox being checked.

Can you advise the coding and at the Table level what type of field the Review Due Date should be.

Thanks.

Michelle
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 01:01
Joined
Apr 27, 2015
Messages
6,286
Which version of Access are you using?

Sent from my SM-J320FN using Tapatalk
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 01:01
Joined
Apr 27, 2015
Messages
6,286
I THINK 2013 has calculated fields. They behave like Excel which is one of the reasons I don't use them. I am on the road right now which is why I can't dedicate some quality time and suggesting them as a quick fix...

Sent from my SM-J320FN using Tapatalk
 

Milnerm

New member
Local time
Today, 05:01
Joined
Jun 23, 2017
Messages
6
Hi

Thank you...you're right about the Calculated fields. I've been able to work with calculated fields before but this one has me stuck because I don't know enough about VBA coding being self-taught.

Michelle
 

Users who are viewing this thread

Top Bottom