Senin, 27 November 2023

Re: [MSAccessProfessionals] Change Value based on another value

Happy to help Bill!



Paul
Sent via mobile device


-------- Original message --------
From: Bill Singer <Bill.Singer@at-group.net>
Date: 11/27/23 9:13 AM (GMT-05:00)
To: MSAccessProfessionals@groups.io
Subject: Re: [MSAccessProfessionals] Change Value based on another value

Paul,

This worked perfectly.

Thanks

 

 

Bill

 

Bill Singer

 

 

 

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> On Behalf Of Paul Baldy
Sent: Wednesday, November 22, 2023 2:43 PM
To: MSAccessProfessionals@groups.io
Subject: Re: [MSAccessProfessionals] Change Value based on another value

 

Something along the lines of:

 

Me.CTICRUHealth  = IIf(Me.CTICOBRACount > 19, 1, 2)

 

In the after update event of CTICOBRACount.  It could also be done with an If/Then block, as you prefer. 

 

Paul

 

 

------ Original Message ------

From "Bill Singer" <Bill.Singer@at-group.net>

Date 11/22/2023 10:22:41 AM

Subject [MSAccessProfessionals] Change Value based on another value

 

I am having a hard time figuring out best way to change the value of 3 fields on a form, based on the initial input in another field.

 

I have a form named         f_PremCollFormSetup

I have a field in that form called     CTICOBRACount

 

When a person enters a value into  CTICOBRACount and if that value is over 19 I want to set/change the value in the fields called  CTICRUHealth  and CTICRUDental to a value of 1

 

And if the value of CTICOBRACount is not over 19 I want to set/change the value to 2.

 

I am having a hard time figuring out where the best place to put this.  I am guessing in the AFTER UPDATE property of the CTICOBRACount field.

 

Do I use iff or If then… 

 

It has been a while since I had to add programming.

 

Thanks for your help.

 

Bill

 

Bill Singer

Bill.Singer@at-group.net

 

 

Tidak ada komentar:

Posting Komentar