If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
switch a radiobutton with vba code?
Is it possible to switch/press a radiobutton with vba code??
I have radiobuttons a-z and a 'show everything ' button to seacrh for records. Besides searching for records with the radiobuttons I made a textbox with a searchbutton. When this searchbutton is pressed I want to press a verry small radiobutton (with code) so that the 'show everything' button can be selected. Is that possible? |
#2
|
|||
|
|||
It's not quite clear what you want to do. What do you mean "a textbox with
a searchbutton"? In any case, pressing a command button can run any code you add to the click event for that button. You don't need to press the radio button with code, you need the code to include whatever exactly happens when you press the radio button. If you need the same code to run from several places you could click Insert Procedure from a code window, then call that procedure from other places. For instance, a public procedure named FindAll that finds all records could be called from a command button's Click event: Call FindAll. You could use code to hide or unhide a botton, if that is what you need to do. You will need to be clearer about your requirements if you need a more specific answer. "A.J.M. van Rijthoven" wrote in message ... Is it possible to switch/press a radiobutton with vba code?? I have radiobuttons a-z and a 'show everything ' button to seacrh for records. Besides searching for records with the radiobuttons I made a textbox with a searchbutton. When this searchbutton is pressed I want to press a verry small radiobutton (with code) so that the 'show everything' button can be selected. Is that possible? |
#3
|
|||
|
|||
OK,
All the searchfunctions worl perfectly. What I want is that, when i press the searchbutton, the state of one button in an option group (26 buttons that act like radiobuttons) is changed from down (pressed) to up. On Wed, 10 Aug 2005 09:25:17 -0400, "BruceM" wrote: It's not quite clear what you want to do. What do you mean "a textbox with a searchbutton"? In any case, pressing a command button can run any code you add to the click event for that button. You don't need to press the radio button with code, you need the code to include whatever exactly happens when you press the radio button. If you need the same code to run from several places you could click Insert Procedure from a code window, then call that procedure from other places. For instance, a public procedure named FindAll that finds all records could be called from a command button's Click event: Call FindAll. You could use code to hide or unhide a botton, if that is what you need to do. You will need to be clearer about your requirements if you need a more specific answer. "A.J.M. van Rijthoven" wrote in message .. . Is it possible to switch/press a radiobutton with vba code?? I have radiobuttons a-z and a 'show everything ' button to seacrh for records. Besides searching for records with the radiobuttons I made a textbox with a searchbutton. When this searchbutton is pressed I want to press a verry small radiobutton (with code) so that the 'show everything' button can be selected. Is that possible? |
#4
|
|||
|
|||
If the button is a toggle button you can add the following to the search
button's click event: Me.tglYourButton = 0 (where tglYourButton is the toggle button's name). You can also use -1 instead of 0 in other code to set it back to a pressed appearance. If it is a command button I don't have anything to suggest other than changing it to a toggle button. "A.J.M. van Rijthoven" wrote in message ... OK, All the searchfunctions worl perfectly. What I want is that, when i press the searchbutton, the state of one button in an option group (26 buttons that act like radiobuttons) is changed from down (pressed) to up. On Wed, 10 Aug 2005 09:25:17 -0400, "BruceM" wrote: It's not quite clear what you want to do. What do you mean "a textbox with a searchbutton"? In any case, pressing a command button can run any code you add to the click event for that button. You don't need to press the radio button with code, you need the code to include whatever exactly happens when you press the radio button. If you need the same code to run from several places you could click Insert Procedure from a code window, then call that procedure from other places. For instance, a public procedure named FindAll that finds all records could be called from a command button's Click event: Call FindAll. You could use code to hide or unhide a botton, if that is what you need to do. You will need to be clearer about your requirements if you need a more specific answer. "A.J.M. van Rijthoven" wrote in message . .. Is it possible to switch/press a radiobutton with vba code?? I have radiobuttons a-z and a 'show everything ' button to seacrh for records. Besides searching for records with the radiobuttons I made a textbox with a searchbutton. When this searchbutton is pressed I want to press a verry small radiobutton (with code) so that the 'show everything' button can be selected. Is that possible? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to switch subform between form and datasheetviews using code | skulmat | General Discussion | 1 | July 5th, 2005 05:51 AM |
Using other workbooks.. | DavidMunday | Worksheet Functions | 4 | July 1st, 2005 07:35 AM |
My switchboards won't work with WinXP ! | Jeff Conrad | Using Forms | 4 | February 25th, 2005 08:51 PM |
SMTP Authentication fails | SharpEye | General Discussion | 0 | February 25th, 2005 08:49 AM |
Outlook XP email goes to sent folder -receipient doesn't receive,. | Jobde | General Discussion | 3 | February 9th, 2005 04:29 PM |