473,587 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hide a Text Box based on Combo Box selection

7 New Member
Hello, I am working on an Access 2007 database and I am having issues on a multiple record form, getting a text box control (titled: IOPCount) to be hidden unless a combo box control (titled: Request_Type) indicates the value "OBS/SUP".

I located a rather fantastic post on this site (here) but when I use this code and I change the Request_Type control of 1 record it hides or unhides the IOPCount control of ALL records. here is the code I used from the above link:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Request_Type_AfterUpdate()
  2.  
  3. If Request_Type = "OBS/SUP" Then
  4.  
  5.           IOPCount.Visible = True     'Set text box to visible
  6.  
  7.      Else
  8.           IOPCount.Visible = False     'Hide the text box
  9.  
  10.      End If
  11.  
  12. End Sub
My question is: "How do I get this code to only hide the IOPCount control of the record it is associated with?"
Jan 6 '14 #1
6 2484
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
Hi and welcome to Bytes
You can't do that sadly, in that way. The controls in a continuous form are "repeated" so to say between records, and as such they share certain properties, such as the .Visible property.

The best you can do in a continuous form is to use conditional formatting.
Jan 6 '14 #2
NeoPa
32,566 Recognized Expert Moderator MVP
DJChaney3
"... but when I use this code and I change the Request_Type control of 1 record ..."
Therein lies the rub. Form controls are not related to any record. They are related to the form. Different instances may show different data, but the control itself is the same whichever record is currently being shown. Any change to the properties of that control will affect any and all records that are shown using that control.

Why Values in Unbound Form Controls do not Persist may be helpful to read for a fuller understanding.
Jan 6 '14 #3
djchaney3
7 New Member
Thank you very much. I have switched over to use Conditional formatting. However I ran into the issue with this were I can not conditionally format the label... why I am not sure but it will not allow it :(

Any idea on that one?
Jan 7 '14 #4
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
I don't really know, as I haven't used it much myself. For me to give any troubleshooting tips however, you need to provide more details on
* What have you tried
* Explain what Access is doing, and what you expected it to do
Jan 7 '14 #5
zmbd
5,501 Recognized Expert Moderator Expert
djchaney3: New Question New Thread (^_^)
Jan 7 '14 #6
djchaney3
7 New Member
Sorry for a second question under same post, but I did figure it out. Thank you all for assisting me
Jan 7 '14 #7

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

Similar topics

1
3718
by: Daniel Hill | last post by:
OK, I have very, VERY basic background knowledge of VB6 and have now upgraded to VB.NET and now I'm struggling to bring up the forms I want. What I am looking to do is to have a click a command button bring up a form, and to have which form is brought up determined by which item is selected in the accompanying combo box. I've gathered...
1
2113
by: thegame | last post by:
Filling One DataGrid Based on Selection from Another DataGrid - Both in Separate User Controls Hello, I have an interesting dilemma. I have an ASPX page with two user controls (two ASCXs). Both ASCXs have DataGrids on them. The first user control's DataGrid is populated from our database on page load. The DataGrid also has a Select...
0
2129
by: ROO | last post by:
Hi Everyone, I have a database table that have 4 field( C1, C2, M1, M2) on my form i have two combo box ComboC and ComboM C1 C2 M1 M2 1 Sales 1 Monthly Terms 1 Sales 2 Annual Terms
5
1508
by: dbuchanan | last post by:
Is it possible to detect the SQLS2K column level permission for the logged in user. I want to be able to hide a control or Button based on user permission to edit that column. Can anyone direct me to example code for this? Thank you, Doug
0
1318
by: moddster | last post by:
I am new to the Java RMI Concept. I am trying to implement the functionality of RMI by using Serialization to create a whiteboard. I want to make a "text based" version of the whiteboard. I have searched google and have only come across graphical whiteboards using RMI which are far to complex for what I am trying to accomplish. If anybody can show...
3
1762
by: Mefistofeles | last post by:
Hello. Need help to make text-based radio buttons. On my calender site I want to have text that works like radio buttons. Exampel, bold text is the selected radio-text. Jan Feb Mar Apr May Jun Jul Aug ..... This is my code right now:
7
6648
by: Nasher | last post by:
i have a combo box (combo box 1) in a form header that users use to selct item numbers from. I also have a combo box (combo box 2) that users use to select a priority number (1,2,3) for that item. This is then stored on the items record. I was wondering if the item has a priority 1 in combo box 2, then it could display the text in combo box 1...
5
6176
by: plumba | last post by:
Hi all. I have two drop down menus, the first a list of Departments, the second a list of Sections. Each Department has a set of Setions, so the Sections dropdown contains complete list of all Sections for every Department. I would like to filter out the Section dropdown based on what Department the user selects, to stop the user selecting...
2
7146
by: rywags11 | last post by:
Hello, Can anyone help me figure out how to show/hide fields based on information entered in other fields in a form in Access 2007? What I'm looking to do is: When a selection from a drop down is chosen, hidden Yes/No fields (check boxes) that apply to that specific information appear and can be updated by users. The other Yes/No fields that...
4
2376
by: dekk | last post by:
I am trying to populate a text field from the combo selection. I have the following update event in the combo box Private Sub cboContract_AfterUpdate() Me!txtDesc = Me!cboContract.Column(1) Me!txtPrinc = Me!cboContract.Column(2) Me.Refresh Me.tbl_TimeData.Form.cboAct.Requery End Sub
0
7918
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
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. ...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
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...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5392
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...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.