473,406 Members | 2,707 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,406 software developers and data experts.

ComboBox to Control Specific Field Display

I am try to limit the fields that are displayed in a subform based on the selection of the combo box.
The table has a StudentName, test1, test2, and test3 among other fields.
I am trying to create a form that will only display the student name and one of the test fields based on a combo box selection.
How can i do this, or is there a better way go about it?

Thanks
Oct 7 '08 #1
3 1857
NeoPa
32,556 Expert Mod 16PB
This is possible to do, but you will need to make your question clearer.

What determines which control, of which set of controls, should be displayed?
Oct 8 '08 #2
I hope this makes it clearer. In the main form all i want to have is the combo box for selecting the field test1, 2, or 3. Then in the sub form the only fields from the table to be displayed would be the StudentName (which would always show) and then the Test 1, 2, or 3 to input their grade depending upon the selection of the combo box.

I know this can be done through setting the combo box to display the field names, but the challenge i am running into is that i do not want create a separate table for the test scores (if i don't have to) so currently when try to set the combo box to display the fields, i am displaying all the fields from the table and not just the three i want to choose from.
Oct 8 '08 #3
NeoPa
32,556 Expert Mod 16PB
Assumptions (As you don't share the names you use, or much really, I'll invent some and you can translate) :
  1. We have an unbound ComboBox control (called cboSelect) on your main form which returns values 1, 2 or 3.
  2. We have a SubForm control named sbfTest on the main form.
  3. We have three controls on the subform called txtTest1, txtTest2 & txtTest3.
You can design the three TextBoxes to be invisible. They can also be designed to take up the same space on the subform, as only one will be visible at any one time.
In the AfterUpdate procedure of the ComboBox (cboSelect) select which TextBox is visible :
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboSelect_AfterUpdate()
  2.   With Me.sbfTest.Form
  3.     .txtTest1.Visible = (Me.cboSelect=1)
  4.     .txtTest2.Visible = (Me.cboSelect=2)
  5.     .txtTest3.Visible = (Me.cboSelect=3)
  6.   End With
  7. End Sub
Let us know how you get on with this.
Oct 8 '08 #4

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

Similar topics

8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
14
by: Thelma Lubkin | last post by:
I am trying to limit the user's options to the choices offered by the combobox text, but I don't want this to extend to how he spaces out the text, e.g. 'abcdefg' and 'ab cd efg' should be...
2
by: Susan Bricker | last post by:
I went back to read my post and found an error in my description ... here is the post, again, corrected: The following error: "The current field must match the join key '?' in the table that...
4
by: Keith | last post by:
Hello - this started out as a minor annoyance - and now is starting to bother me more and more - I'm hoping someone can help me. I would like to have a combobox display - NOT initially be blank...
4
by: Stewart Lane | last post by:
I have read the threads on here about adding a calculated column to a dataset to get the concatenation of first and last name fields into a single name field and then binding the calculated field...
0
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
4
by: JJGarcia | last post by:
Hi Everyone, I'll try to explain the process I'm following, I'm new to this so I'm triying the easy way first, probably the lasyest too! I created a new Project, drag in to it a SQLConnection,...
2
by: gleadams | last post by:
I have databound a Windows form ComboBox control to a DataSource and DataMember and it is properly showing the data as I navigate through the records. My question concerns the choices in the...
1
by: Rosie | last post by:
I have a main form with header info w/ 'tHeader' as the control source. I have a subform with 'tDetail' as a control source. They're strung together by a field named MA_ID. This works...
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: 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.