Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

Option Button does not Toggle

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michelle - 05 Jul 2007 16:40 GMT
I have an option button where I want the default value to be "Active".  In
the Option Group Frame I have the default value set as "1".  When a user
clicks on the "Active" button  I want the backcolor of my form to remain the
same, when a user clicks on the "Inactive" button I want the backcolor of the
form to turn red.  I have put a macro in the "After Update" procedure and the
code works but it doesn't "deselect" the button when I click on the other
button.  I have to click Active, then click it again to take the focus off
before I click Inactive.  If I don't do this, both boxes remain checked (the
color does change how I want it).  Is there a way to make the buttons
"toggle" or "lose focus".  Thanks.

My macro looks like this...
Klatuu - 05 Jul 2007 19:26 GMT
my guess is you are using the wrong After Update.  You use the After Update
event of the Option Group, not the button.  And if you are using a macro, you
will have to tell it what option was chosen so it knows how to handle the
colors, etc.
Signature

Dave Hargis, Microsoft Access MVP

> I have an option button where I want the default value to be "Active".  In
> the Option Group Frame I have the default value set as "1".  When a user
[quoted text clipped - 8 lines]
>
> My macro looks like this...
Michelle - 05 Jul 2007 19:42 GMT
But how do I clear out the "Active" checkbox when I select the "Inactive"
checkbox.  Is there code for that?  

Usually when I create an option button I can select one or the other.  But I
have a single form and when I use that it changes all the records to a blue
background.  Or all the records to a red background.  I need each record to
be the color based on what the user selects (active - blue) (inactive - red).

Hope this makes sense.

> my guess is you are using the wrong After Update.  You use the After Update
> event of the Option Group, not the button.  And if you are using a macro, you
[quoted text clipped - 13 lines]
> >
> > My macro looks like this...
Klatuu - 05 Jul 2007 19:46 GMT
Sound like you are using a datasheet view.  That is the way datasheet view
works. If you change it to a continuous form and use conditional formatting,
it should slove your problem.  You wont have to do anything to change the
colors in the after update event.
Signature

Dave Hargis, Microsoft Access MVP

> But how do I clear out the "Active" checkbox when I select the "Inactive"
> checkbox.  Is there code for that?  
[quoted text clipped - 23 lines]
> > >
> > > My macro looks like this...
Michelle - 19 Jul 2007 16:32 GMT
If I switch to continuous form, will that make all my records the same color?
I would like to keep each record it's own color based on being "active" or
"inactive".  Thanks.

> Sound like you are using a datasheet view.  That is the way datasheet view
> works. If you change it to a continuous form and use conditional formatting,
[quoted text clipped - 28 lines]
> > > >
> > > > My macro looks like this...
Klatuu - 19 Jul 2007 16:36 GMT
Yes
Signature

Dave Hargis, Microsoft Access MVP

> If I switch to continuous form, will that make all my records the same color?
>  I would like to keep each record it's own color based on being "active" or
[quoted text clipped - 32 lines]
> > > > >
> > > > > My macro looks like this...
John W. Vinson - 19 Jul 2007 18:31 GMT
>If I switch to continuous form, will that make all my records the same color?
> I would like to keep each record it's own color based on being "active" or
>"inactive".  Thanks.

You can use Format... Conditional Formatting on the menu to color code
textboxes on the continuous form.

            John W. Vinson [MVP]
Michelle - 19 Jul 2007 19:40 GMT
Thanks John.  I'm trying to make the detail backcolor of the form a different
color based on the click event of an option group.  Is this possible?

> >If I switch to continuous form, will that make all my records the same color?
> > I would like to keep each record it's own color based on being "active" or
[quoted text clipped - 4 lines]
>
>              John W. Vinson [MVP]
John W. Vinson - 20 Jul 2007 00:54 GMT
>Thanks John.  I'm trying to make the detail backcolor of the form a different
>color based on the click event of an option group.  Is this possible?

Well, a continuous form has only one background (for the whole form), not a
different background for each line. Perhaps you could use a transparent
unbound textbox overlaying the entire detail section and toggle its color.

            John W. Vinson [MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.