473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to use toggle/option buttons on a form in Acc2003

8,435 Expert 8TB
Hi all.

I'm coming from a VB6 background so this is just confusing me a little. I have a form where the user can select one of a number of years to search. The selection doesn't relate directly to any particular table or field in the database, but will be used in code later to build queries.

I have tried putting a bunch of radio/option buttons in a frame, and also tried putting a bunch of toggle buttons on the form, and run into the same problem either way. How do I tell when one of them is selected, so I can change some defaults displayed on the form?

In VB6, of course, it would be a very simple matter to code behind the Click event. But the nearest events I can find for these controls are the KeyUp/Down and MouseUp/Down, which are really not what I want. For one thing, they still fire even if, for example, you press the mouse then move off the button, and so don’t select it.

Any help is appreciated.
Oct 25 '06 #1
5 3335
MMcCarthy
14,534 Expert Mod 8TB
Drag an option group onto the form from the toolbar.

Use the wizard to set up the basic group. It will allow you to assign an integer value to each option. It will default to 1, 2, 3, etc.

Put your code in the On Click event of the Frame rather than the buttons.

Then code using select case statement

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Frame1_Click()
  3.     Select Case Frame1
  4.  
  5.     Case 1
  6.         ' do something
  7.     Case 2
  8.         ' do something
  9.     Case 3
  10.         ' do something
  11.     Else
  12.         ' do something
  13.     End Select
  14.  
  15. End Sub
  16.  
  17.  
Oct 25 '06 #2
NeoPa
32,556 Expert Mod 16PB
Radio buttons come within a frame.
The AfterUpdate event will trigger every time the operator changes the selection.
Oct 25 '06 #3
Killer42
8,435 Expert 8TB
Radio buttons come within a frame.
The AfterUpdate event will trigger every time the operator changes the selection.
Thanks to both of you. In this case I think the frame's OnClick event is the better fit for what I'm doing.
Oct 26 '06 #4
NeoPa
32,556 Expert Mod 16PB
So, beaten by a quicker AND more appropriate post... MMcCarthy does it again - Grrrr.
Seriously, it's cool you've got a good answer.
Oct 26 '06 #5
Killer42
8,435 Expert 8TB
So, beaten by a quicker AND more appropriate post... MMcCarthy does it again - Grrrr.
Seriously, it's cool you've got a good answer.
Need to brush up on those speed-typing skills. :)
Oct 26 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Robert | last post by:
Hello. I have been trying out the Lebans ToolTip Classes at http://www.lebans.com/tooltip.htm, to display "balloon" style help tips in a form. The classes I am using are located at...
0
by: Aravind | last post by:
Hi folks. I have a form, frmHistory, which has 3 toggle buttons (1 of which is tglName, which I will be using to demonstrate my problem). The buttons are used to sort the form (explanations...
11
by: MLH | last post by:
Why is that? If I choose the tiny check boxes which are hard to hit with a mouse, it works fine. But option buttions, shich can be sized big enough for people with limited sight and dexterity...
4
by: Neil Coleclough | last post by:
I am constructing a database to process product returns for my Company. I have a number of toggle buttons to identify the stage to which each return has been processed. For example, clicking the...
1
by: Stephen D Cook | last post by:
In my form I have an option group with 3 option buttons. My form is tied to a table. the options are Temp, Permanent and Overtime. I have these inside a frame. I have an AddRecord button to enter...
3
by: Killer42 | last post by:
Hi all. I have a frame with some toggle buttons in it. All is working fine, except that the user can't tell which option is selected to begin with. How do I set one of the toggle buttons to the...
2
stonward
by: stonward | last post by:
Hiya People, I've put two toggle buttons in a frame...so only one can be 'active' at any one time. When one is 'live' (option 1, say) I want the Form to show my Trade price values, when the other,...
2
by: Chuck | last post by:
How can I make an array of command buttons (or toggle buttons) on a form and have a text box on the same form display the index of the button clicked? This works very well in VB6, but I can't...
2
by: 6afraidbecause789 | last post by:
Hi - Has anyone ever used toggle buttons to select items in a listbox? I'd like to put about 24 toggle buttons on an unbound form that select or deselect items in a multiple select listbox. I've...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.