Jumat, 31 Agustus 2012

RE: [MS_AccessPros] Problem with checkboxes randomly disappearing

 

A lot easier to read, but you are missing one step. The original code sets
the value for chkPassEyeMRR as well.

John. Visio MVP

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Bill Mosca
Sent: Friday, August 31, 2012 12:44 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Problem with checkboxes randomly disappearing

John

You can do it with less typing this way:
[chkFailEyeMRR].Visible = ([chkPassEyeMRR] = False)

If the the expression on theright side is True the chkbox will be visible.

Capeesh?

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-6427073088
1E
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com

--- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> , "jfakes.rm"
<jfakes@...> wrote:
>
> Ok, I tweaked my statements and it is now working.
>
> Here is what I used:
>
> 'Hides checkboxes if one of the other check boxes are checked.
> If [chkPassEyeMRR] = True Then
> [chkFailEyeMRR].Visible = False
> Else
> [chkFailEyeMRR].Visible = True
> End If
>
> If [chkFailEyeMRR] = True Then
> [chkPassEyeMRR].Visible = False
> Else
> [chkPassEyeMRR].Visible = True
> End If
>
> --- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> , "jfakes.rm" <jfakes@>
wrote:
> >
> > Crystal,
> > I tried using the Load event, however, when the form opens, it is
filtered so the checkboxes aren't always shown so I get and error "you
entered an expression that has no value."
> >
> > John F
> >
> > --- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> , Crystal
<strive4peace2008@> wrote:
> > >
> > > Hi John,
> > >
> > > perhaps you want to use the form LOAD event -- this fires one time,
when the data is loaded. The Current event is triggered upon landing on
another record, or a new record
> > >
> > > ... but rather than doing this, why don't you use option buttons
instead of checkboxes? That way they become mutually exclusive
automatically :)
> > >
> > > anyway, there is often a better way than using checkboxes ... for
instance, store a date/time, and a result like Pass or Fail
> > >
> > >
> > > Warm Regards,
> > > Crystal
> > >
> > > Learn Access on YouTube
> > > http://www.YouTube.com/LearnAccessByCrystal
> > > ________________________________
> > > From: jfakes.rm <jfakes@>
> > > To: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
> > > Sent: Friday, August 31, 2012 8:32 AM
> > > Subject: [MS_AccessPros] Problem with checkboxes randomly disappearing
> > >
> > > I had an issue with two checkboxes randomly disappearing on a form in
MS Access 2003. What I am trying to do is if a person passes an eye exam,
the chkPassEyeMRR is checked so I don't want to see the chkFailEyeMRR
checkbox.
> > >
> > > Below is the code I am using in the "On Current" event.
> > >
> > > 'Hides checkboxes if one of the other check boxes are checked.
> > > If [chkPassEyeMRR] = True Then
> > > [chkFailEyeMRR].Visible = False
> > > ElseIf [chkFailEyeMRR] = True Then
> > > [chkPassEyeMRR].Visible = False
> > > Else
> > > [chkPassEyeMRR].Visible = True
> > > [chkFailEyeMRR].Visible = True
> > > End If
> > >
> > > When I open the form, the pass or fail checkbox displays properly.
However, as I move from record to record, the checkboxes randomly disappear
and reappear.
> > >
> > > I have similar code for different controls on a separate tab on the
same form and that code works and the textboxes display properly.
> > >
> > > Any idea what is going on and how I can fix the issue?
> > >
> > > John F
> >
>

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar