(Msg. 1) Posted: Tue Aug 26, 2008 12:08 pm
Post subject: Calculated Checkbox values Archived from groups: microsoft>public>access>gettingstarted (more info?)
Im trying to set a checkbox value to a "true" or "checked" state when another
field is equal to, or greater than another value in another field.
What would be the best way to do this?
(I guess I cant apply conditional formatting to checkboxes?)
(Msg. 2) Posted: Tue Aug 26, 2008 1:11 pm
Post subject: RE: Calculated Checkbox values [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Conditional formatting doesn't have any effect on a control's value, only how
it looks. Here is a one liner that will do it:
Me.MyCheckBox = Me.SomeField <= Me.AnotherField
--
Dave Hargis, Microsoft Access MVP
"Wookawsh" wrote:
> Im trying to set a checkbox value to a "true" or "checked" state when another
> field is equal to, or greater than another value in another field.
> What would be the best way to do this?
> (I guess I cant apply conditional formatting to checkboxes?)
>
> Thanks for the help.
> --
> Lukasz
(Msg. 3) Posted: Tue Aug 26, 2008 3:36 pm
Post subject: Re: Calculated Checkbox values [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Put the following code in the Current event of your form:
If Me!NameOfFirstField = Me!NameOfSecondField Then
Me!NameOfCheckBox = True
Else
Me!NameOfCheckBox = False
End If
Steve
"Wookawsh" <Wookawsh DeleteThis @discussions.microsoft.com> wrote in message
news:E7EB91C1-F0A0-4F17-847D-2851423868CC@microsoft.com...
> Im trying to set a checkbox value to a "true" or "checked" state when
> another
> field is equal to, or greater than another value in another field.
> What would be the best way to do this?
> (I guess I cant apply conditional formatting to checkboxes?)
>
> Thanks for the help.
> --
> Lukasz
(Msg. 4) Posted: Wed Aug 27, 2008 5:04 am
Post subject: Re: Calculated Checkbox values [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Also you will have to add that very same code to the after update
event of the two fields used in the logic.
If you do not do this then when you change either of them the checkbox
will NOT be changed until you get off of and return to the record.
(Msg. 5) Posted: Wed Aug 27, 2008 7:11 am
Post subject: Re: Calculated Checkbox values [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Good point, Ron, and in the Current event, probably
--
Dave Hargis, Microsoft Access MVP
"Ron2006" wrote:
> Also you will have to add that very same code to the after update
> event of the two fields used in the logic.
>
> If you do not do this then when you change either of them the checkbox
> will NOT be changed until you get off of and return to the record.
>
> Ron
>
(Msg. 6) Posted: Wed Aug 27, 2008 8:03 am
Post subject: Re: Calculated Checkbox values [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
(Msg. 7) Posted: Wed Aug 27, 2008 8:14 pm
Post subject: Re: Calculated Checkbox values [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
--
Lukasz
"Ron2006" wrote:
> Yes
> Thank You for the prompt responses, its really impressive. I just need a little more help. My coding experience is limited.
First, I should have been more clear. This is the exact statment that I need
to execute
When Field 1 >= 12, then Checkbox 1 = Yes/Checked
(also will having this violate any database rules, as the checkbox value is
in one of my tables (i.e. is this like a calculated value?))
Ive found the "after update" in the code builder section, but I couldnt find
the "current event" field"
Once again your help and quick responses are appreciated. Thanks.
(Msg. 8) Posted: Thu Aug 28, 2008 5:46 am
Post subject: Re: Calculated Checkbox values [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
The OnCurrent event is an event for the form NOT a field.
It is the first one on the event tab on the properties for the form
itself.
All times are: Eastern Time (US & Canada) (change) Goto page 1, 2
Page 1 of 2
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum