473,809 Members | 2,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

change a property sheet control depending on the selection selected on a radio field

18 New Member
Hello,

I have been reading thru various questions in the Bytes forum and none really answers this completely so here I am.

I have a radio button field that displays several options and you can only select one.

My goal is to make a certain selection trigger a change in a text box. for example, if I select reject in the radio field then the text box background would go red.

Will that require VBA? and is there an easy way to do this? any help will be awesomely appreciated

Matt
Nov 18 '09 #1
5 2775
ChipR
1,287 Recognized Expert Top Contributor
This is a cool idea that you can do without any real code. Right click the text box and select Conditional Formatting. Now set a Condition to "Expression Is" and [YourOptionGroup Name] = 1, or whatever the value of that option is on the radio button's Data tab.
Nov 18 '09 #2
DBlearner
18 New Member
I love Conditional formatting but I only can use up to three conditions. I probably will need at least 5 or 6. Plus I want to turn off/on some property sheet control too.
Nov 18 '09 #3
ChipR
1,287 Recognized Expert Top Contributor
You will need to write some code in the AfterUpdate event of the option group.
Nov 18 '09 #4
DBlearner
18 New Member
Chip,

Can you point me in the right direction regarding writing codes? There's so many different codes, etc. Can you give me the exact code name so I can google it and learn how to write, nest the code properly?

I am so frustrated! I am almost done with the database except for this one ;-) any help would be so appreciated.

Matt
Nov 25 '09 #5
ChipR
1,287 Recognized Expert Top Contributor
This will depend on what you want to do, but I'll try to point you in the right direction.

In design view, open the Property Sheet for the Option Group. On the Event tab, find After Update and choose Code Builder. Access makes your procedure for you, which will be run when the event is triggered. It looks like:
Expand|Select|Wrap|Line Numbers
  1. Private Sub myOptionsGroup_AfterUpdate()
  2.  
  3. End Sub
Now you can put whatever code you want in there. Ignoring variables for now, we're going to use code to manipulate the Properties of some Control on the form. Say there is a text box on your form called myTextBox.

You can refer to the properties of the text box with the . character. To find out what properties you can change, check the Textbox Object Members.

Now, the default Property of a text box is .Value. This allows us to write
Expand|Select|Wrap|Line Numbers
  1. myTextBox = "hi"
To set other properties we would write
Expand|Select|Wrap|Line Numbers
  1. myTextBox.BackColor = vbRed
For each property, there is a page like TextBox.BackCol or Property that tells you what it does, when and how to set it, and gives examples.

If you want to work with some other control, just look it up in the Access Object Model Reference and see what properties it has, and what you can set them to. After the textbox object, the Form object will probably be the most useful to learn.

Sorry for the long post, but I hope this gets you where you want to go.
Nov 25 '09 #6

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

Similar topics

1
1563
by: bdawg | last post by:
what i want to do is create several radio buttons and a textbox for searching purposes. the search will perform a search depending on which button the user selects. here is what i have now: - for each radio button, i use the onClick event handler, which calls a function called showMe() - showMe() {
4
21035
by: JohnSouth104 | last post by:
Hi I want to warn the user that changing the selected item in a pull-down will clear some data he has already entered in a file download box. I've tried using confirm() to return true or false with a line such as: onchange="return(confirm('proceed Yes or No')))" but it always stops the change.
3
3545
by: Alpha | last post by:
I have 3 radio buttons for include, exclued or 'select all' from the listbox items. If a user selects the 'Select All' button' then all items in listbox is hi-lited as selected. Now, when user selects one item out of the 'all selected' listing then there is now only one item selected. How and where can I put in some code to change the selected radio button to the 'include' since it is no longer in select all mode. Thanks, Alpha
2
3774
by: Bob Alston | last post by:
I have an application with several forms. Most forms use radio boxes for Yes/No choices. On a few of these, once one option is selected, the user cannot change the selection without moving to another field and then entering the change on the original checkbox. I should mention that there is a background image underneath the entire form. Sometimes I can select any choice and then select the other. On other sets of Yes/No radio...
0
2182
by: jianxin9 | last post by:
Hi everyone, I don't have a lot of experience with ASP and I was hoping someone could help me. I want to use our ASP form along with some javascript code to create a form where our patrons can select which department they will send the form to (we are trying to consolidate forms). This is what I have so far, but when I test the form, I keep getting this error message: Mailing Failed... Error is: FromAddress Property cannot be blank. You...
8
3279
by: mlwerth | last post by:
Dear Access Group: This is the most basic and most embarrassing of questions, but I cannot find where to change the data type of a text field that I have in Access 2003 to a number field. I've searched high and low through help databases and on the internet. The directions say to : Open the table in Design view Click the Data Type column of the field you want to change, click the
5
1989
by: agarwasa2008 | last post by:
Hi, I have a linked table called tbltest and some bounded forms (which add, update, delete records) that were created using that linked table. For some necessary reasons I had to create another linked table called tblComponents and then I bounded the original forms to this new table. I did change the control source: Description (Field name) RowSource Type: Table/Query (which remains the same)
0
10635
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10378
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7653
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3013
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.