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.
5 3335
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 -
-
Private Sub Frame1_Click()
-
Select Case Frame1
-
-
Case 1
-
' do something
-
Case 2
-
' do something
-
Case 3
-
' do something
-
Else
-
' do something
-
End Select
-
-
End Sub
-
-
NeoPa 32,556
Expert Mod 16PB
Radio buttons come within a frame.
The AfterUpdate event will trigger every time the operator changes the selection.
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.
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.
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. :)
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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...
|
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...
|
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,...
| |