WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Calculated Checkbox values

 
Goto page 1, 2
   Home -> Office other -> Getting Started RSS
Next:  #Name? on subform where text should be  
Author Message
Wookawsh

External


Since: Aug 17, 2008
Posts: 7



(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?)

Thanks for the help.
--
Lukasz
Back to top
Login to vote
Klatuu

External


Since: Apr 06, 2005
Posts: 2923



(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
Back to top
Login to vote
Steve

External


Since: Jul 10, 2008
Posts: 311



(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
Back to top
Login to vote
Ron2006

External


Since: Apr 18, 2007
Posts: 110



(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.

Ron
Back to top
Login to vote
Klatuu

External


Since: Apr 06, 2005
Posts: 2923



(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
>
Back to top
Login to vote
Ron2006

External


Since: Apr 18, 2007
Posts: 110



(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?)

Yes
Back to top
Login to vote
Wookawsh

External


Since: Aug 17, 2008
Posts: 7



(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.
Back to top
Login to vote
Ron2006

External


Since: Apr 18, 2007
Posts: 110



(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.

Ron
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> Getting Started 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
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET