473,386 Members | 1,647 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,386 software developers and data experts.

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

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 2754
ChipR
1,287 Expert 1GB
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 [YourOptionGroupName] = 1, or whatever the value of that option is on the radio button's Data tab.
Nov 18 '09 #2
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 Expert 1GB
You will need to write some code in the AfterUpdate event of the option group.
Nov 18 '09 #4
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 Expert 1GB
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.BackColor 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
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: ...
4
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...
3
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...
2
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...
0
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...
8
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...
5
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.