473,513 Members | 11,702 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 2474
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,557 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
3714
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...
1
2111
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). ...
0
2124
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 ...
5
1506
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...
0
1315
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...
3
1750
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...
7
6636
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....
5
6171
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...
2
7134
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...
4
2366
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)...
0
7254
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
7153
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
7432
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...
1
7094
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
5677
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,...
0
3230
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...
0
1585
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 ...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
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...

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.