Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 20th, 2005, 09:56 AM
alex_lee822 alex_lee822 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 43 alex_lee822 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 41 m 15 sec
Reputation Power: 4
Arrow Select a option button when filter is on

Hi,

I want a option button to be selected (looks like a light bulb when changed the color to green) when the filter is on. I have a combobox for the filter to occur.

I'm thinking.. do I put the condition in "OnFilter" section in the properties?... But I don't know what the code is to "select" the option button so that the "black" dot appears in the circle.

Thanks!

Reply With Quote
  #2  
Old January 20th, 2005, 11:13 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Not sure if I understood exactly what you want, but as far as the option group with radio buttons (circles with a black dot), each "circle" has a value...generally starting at 1 by default and incrementing from there unless you have changed the value for them. So you can set the item or circle to show a dot by simply stating the value for the option group. i.e OptionGroup.Value = 1 would place a black dot in the circle to the item that has a value of 1. You can place this in any event for which you want it to trigger. Be sure to use the actual name of the option group. Now for the rest of your post "looks like a light bulb when changed the color to green"??? Lost me on that one.

lwells

Reply With Quote
  #3  
Old January 20th, 2005, 01:41 PM
alex_lee822 alex_lee822 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 43 alex_lee822 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 41 m 15 sec
Reputation Power: 4
Ok, so I have a combobox that has a macro that applies filters (ApplyFilter). I want the optiongroup to have a value of 1 (OptionGroup.Value=1) ... so that it has a black dot in it. Is that possible?

Thanks

Reply With Quote
  #4  
Old January 20th, 2005, 03:05 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
That is correct. In the After Update of your combo box, place your code in the forms module (Click on the elipse button "..." next to the dropdown arrow when your curser is in the textbox for the AfterUpdate Event and select code builder) for that event. Now you will need to identify which radio button (if you have more than one) you want to have a black dot in it. So you will have to make some adjustments in how you will identify what was selected in the combobox to determine which radio button will have a black dot in it. There are several different ways to do this, but what I would recommend is to use the bound column of your combobox to identify what radio button goes with what is selected using the Select Case method.

Select Case Combobox - use the name of your combo box
Case "Whatever is in the bound column here"
OptionGroup.Value = 1
Case "Whatever is in the bound column here"
OptionGroup.Value = 2
... etc.
End Select

There are several other methods that can be used, but this might be the easiest to do.

If you only have one radio button, (used to visually identify that a filter is on), then all you would need is to do is place the code OptionGroup.Value = 1 in the AfterUpdate event of the combobox. Make sure that the value of the radio button is 1 and make sure you use the name of your option group in the code where I have it in bold.

lwells

Last edited by lwells : January 20th, 2005 at 03:14 PM.

Reply With Quote
  #5  
Old January 21st, 2005, 08:58 AM
alex_lee822 alex_lee822 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 43 alex_lee822 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 41 m 15 sec
Reputation Power: 4
"If you only have one radio button, (used to visually identify that a filter is on), then all you would need is to do is place the code OptionGroup.Value = 1 in the AfterUpdate event of the combobox. Make sure that the value of the radio button is 1 and make sure you use the name of your option group in the code where I have it in bold."


This is exactly what I want... I tried it out, but it doens't work. Why? I placed the OptionGroup.Value=1 (with my own option radial button name: FilterIndicator) in the AfterUpdate section of the combobox properties. But it doesn't do anything to the radial button when I filter my records. Why?

Thanks

Reply With Quote
  #6  
Old January 21st, 2005, 10:34 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
My apologies, I need to be more specific for you. You need to use the name of the option group itself, not the name of the radio button. Typically this will be the square or rectangular frame that access by default places around the group of radio buttons. Generally by default, access gives this the name of Frame1 etc. What you want to do, is select the frame that is around your option group in design view, then in properties find out what name access assigned to the option group as a whole and use that name in the procedure. The value that the radio button itself, which is a number will be what you place after the equal sign.

OptionGroup = OptionGroupButton.Value

In other words, you are telling access that the option group has a button with a specific value that you want to assign. So if the option group is the first option group that was put on your form, it most likely will have the name Frame1 unless you have changed it. The value of the radio button, will generally be 1, unless you have changed it. So the syntax would look like Frame1.Value = 1 meaning the option group as a whole will equal the value of one specific button that you want.

lwells

Last edited by lwells : January 21st, 2005 at 10:41 AM.

Reply With Quote
  #7  
Old January 21st, 2005, 01:00 PM
alex_lee822 alex_lee822 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 43 alex_lee822 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 41 m 15 sec
Reputation Power: 4
I have found the name, but it's Frame28.. I think it's because i have other option groups in my form.. but anyways.. I put Frame28.Value=1 in the AfterUpdate part of the combobox, and i tried it out.. but it has a pop up saying it cannot find the macro 'Frame28'... i tried putting "=Frame28.Value = 1" in the AfterUpdate, but it does not work...

what can I do next?

Reply With Quote
  #8  
Old January 21st, 2005, 01:23 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Ahh...you need to put this in the code window. When you place your curser in the textbox next to the AfterUpdate a little arrow will appear on the right side. Next to the arrow will be the elipse button. Thats a button with three little dots "..." Click on that button and it will open a menu. Select Code Builder. This will open the code window with the curser placed between two lines First Line will be Private Sub and the last line will be End Sub. Place your code between these two lines. Frame28.Value = 1

That should take care of it.
lwells

Reply With Quote
  #9  
Old January 21st, 2005, 02:50 PM
alex_lee822 alex_lee822 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 43 alex_lee822 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 41 m 15 sec
Reputation Power: 4
oh.. it works now.. thanks.. but one thing is weird.. i put the radial button name (ie. Option319) rather than the "Frame28" and it works..

Thanks very much

Reply With Quote
  #10  
Old January 21st, 2005, 03:31 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
The call can be made to the button as well, but normally I like to make the call to the group as a whole. Being consistent when writing code throughout your application will make it much simplier down the road when you need to make changes or add additional code. You will find many different ways to perform specific actions when writing code. Some ways are more efficient than others and others are just a matter of preference. My preference is to call the group as a whole rather than the individual control. So whatever method you prefer to use will be okay.

lwells

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Select a option button when filter is on


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT