A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

switch a radiobutton with vba code?



 
 
Thread Tools Display Modes
  #1  
Old August 10th, 2005, 12:41 PM
A.J.M. van Rijthoven
external usenet poster
 
Posts: n/a
Default 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  
Old August 10th, 2005, 02:25 PM
BruceM
external usenet poster
 
Posts: n/a
Default

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  
Old August 10th, 2005, 02:48 PM
A.J.M. van Rijthoven
external usenet poster
 
Posts: n/a
Default

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  
Old August 10th, 2005, 03:11 PM
BruceM
external usenet poster
 
Posts: n/a
Default

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

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 Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 05:33 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.