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

Link two Fields

10
I am newbie working on Access.
I am asked to create a new database screen with "Letter Variables" as the field name.
Letter variables is a radio button with Yes and No fields.
If an Yes radio button is selected, additional fileds
variable name ( a text box),
Variable type ( a text box) ,
variable field name( a text box),
Variable Format ( a text box),
must be visible and the user must be able to enter data into these text boxes. and when a No radio button is selected, the user is not allowed to enter the data into these text boxes.

I am using forms and created radiobuttons with Yes or No fields. and also created the text boxes in the forms. Now Could any body explain me how to assosiate the radio button field with the textbox field.
Jan 26 '09 #1
2 2193
DonRayner
489 Expert 256MB
First off you need to create an option group to hold your yes/no radio buttons. and then add the radio buttons to the option group.

By default the option value property is set to 1 for the first radio button added 2 for the next and so on, or you can change them to whatever order you want.

You can set either the yes or no buttons as the default for the option group. If you select the yes radio button as the default make sure that the enabled property is set to yes for all of the controls that you want enabled , if you set no as the default then make sure that the controls enabled propertys are set to no

I'll assume that you have set yes = 1 and no = 2 and the option group name = Letter_Variables.

You would add code something like the following into the after update event of the Letter_Variables control. FieldName1.... would be whatever the names of the text fields are that you want to control. you could also use the .visible property if you want to hide/show them.

Expand|Select|Wrap|Line Numbers
  1. Select Case Me.Letter_Variables
  2. Case = 1       'Yes button selected
  3. me.FieldName1.Enabled = true
  4. me.FieldName2.Enabled = true
  5. me.FieldName3.Enabled = true
  6. and so on.......
  7.  
  8. Case = 2       'No button selected
  9. me.FieldName1.Enabled = false
  10. me.FieldName2.Enabled = false
  11. me.FieldName3.Enabled = false
  12. and so on.......
  13.  
  14. Case Else
  15. Exit Sub
  16. End Select
  17.  
Jan 26 '09 #2
NeoPa
32,556 Expert Mod 16PB
Radio Buttons don't work like that (See Don's post). It sounds like you actually need a CheckBox control instead.

In short, Radio Buttons allow you to select (only) one item from a group. CheckBoxes allow you to set True or False (Yes / No).

Bearing in mind the value of a standard CheckBox is either True or False, and that the .Locked property of a control is also either True or False, you can simply set the .Locked property to the value of the CheckBox any time that control is changed.
Expand|Select|Wrap|Line Numbers
  1. Me.[Variable Name].Locked = Me.[Letter Variables]
  2. Me.[Variable Type].Locked = Me.[Letter Variables]
  3. ...
Jan 27 '09 #3

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

Similar topics

4
by: Chas | last post by:
I am using this code <table border="1"> <% Do While Not rstSimple.EOF %> <tr> <td><%= rstSimple.Fields("username").Value %></td> <td><%= rstSimple.Fields("password").Value %></td> <td><%=...
2
by: Deborah V. Gardner | last post by:
I am using Access 97 and have had a problem joining a main form and a subform. I have a main form and a subform. The data source on the main form is a SELECT statement referring to three tables....
4
by: Melissa | last post by:
I have a frontend file named CustomerApp and backend file named CustomerData. CustomerApp is at C:\Customer Database and CustomerData is at S:\Customer Database. Could someone help me with the code...
3
by: Mark C | last post by:
I have a unbound form with a tab control with four tabs in an Access 97 database. On each tab I have a sub form each form on the sub forms is bound to its own table. Each table has a field that can...
0
by: Ace Calhoon | last post by:
Hello, Using Access 2003 SP-1. I have a form which contains a subform. Each form represents a table, and is linked by two fields. These fields are also related in the underlying tables, with...
2
by: Luis E Valencia | last post by:
I want a row of the datagrid with a personalized link. The fields of the link are on the select related to the datagrid the link would be accoiones.aspx?iddireccion=2&idindicador=5 I tried...
0
by: Luis E Valencia | last post by:
Read from above to top. I didnt understand. This is the code that fills that datagrid Public Sub pasar(ByVal sender As System.Object, ByVal e As...
11
imrosie
by: imrosie | last post by:
Hello Experts This is a hard one (I still speak newbie). An expert may think it's not a big deal, but, I am trying to replace my Main Order form with a subform because of the following: ...
1
by: Yubin | last post by:
Hello, I'm new to the forums and I wasn't able to find anything in my searches so here we are. I have a DB with a many-2-many relationship. I have a form that has 3 comboboxes: Project #, Last...
2
by: fran7 | last post by:
Hi, I have this very nice link tracker script that works a treat. The only thing is it doesnt restrict repeat clicking. Is there a simple method to add a cookie feature to this so that people...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
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,...
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
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...
0
tracyyun
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...
0
agi2029
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,...

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.