472,958 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Show / Hide Fields

Is it at all possible to show or hide fields based on a selection from a drop down box. I am new to access but have built a database, I have around 7 different options to choose from. But only one should trigger the other fields to appear.

Thanks 🙏 again for your help...
May 16 '21 #1
2 2988
NeoPa
32,547 Expert Mod 16PB
Not only possible, but a common requirement :-) Welcome to Bytes.com.

In the _AfterUpdate() event procedure you would have code that sets the visibility of other Controls (Not Fields exactly - Fields do little more than hold data whereas Controls are a little more complicated.) based on the value found in your other Control.

At a very basic level, if you have a Form (frmX), a ComboBox Control (cboY) and just one TextBox Control (txtZ) to be shown (if cboY = "A") or hidden (if cboY = {anything else}) then you would want code based on this simple template :
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboY_AfterUpdate()
  2.     Dim blnVisible As Boolean
  3.  
  4.     With Me
  5.         blnVisible = .cboY = "A"
  6.         .txtZ.Visible = blnVisible
  7.     End With
  8. End Sub
May 16 '21 #2
isladogs
443 Expert Mod 256MB
For info, if this is being done in a table, query or datasheet form, you can just right click and Select Hide Fields
May 17 '21 #3

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

Similar topics

9
by: sergio | last post by:
Hi all, I have created the following script that will show/hide a menu based on checkboxes. It works fine in Opera but not on IE6! Does anybody knows a workaround this problem? Thanks for your...
10
by: oLE | last post by:
I would like to add some javascript to show/hide a certain row of a table. The first row of the table contain the hyperlink that calls the javascript the second row is the one i want to show/hide...
3
by: alex | last post by:
I'd like to have a show/hide widget on my web site, kind of like "show details" / "hide details" in Google Groups. Is there a tutorial explaining how to make them? Google's is a bit complex and...
4
by: bridgemanusa | last post by:
Hi All: I have a very long page of html that I want to take portions and hide them in divs, then show when a link is clicked. I have the hide show part working when the link is clicked, however...
2
by: UJ | last post by:
Is there a way with a asp:checkbox to run a JavaScript to display/hide text/input on the screen without doing a postback? I also need to be able to access the stuff at the server so I need to...
7
by: FP | last post by:
I'm new to Java Script. I'm displaying comments people have made. Below each persons' comment I want to add 2 buttons "Reply" and "Amend". Clicking "Reply" would display an empty text field...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
2
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...
2
by: Scott McNeill | last post by:
I have created a form with show/hide on a couple of fields. However, this hidden info is not posting back when I click submit. Can someone help? Source code <?xml version="1.0"...
3
by: Wayne Eveleigh | last post by:
Hi, I am working on a table with asp and I would like to add a feature to show/hide all rows within the a section of the table. This code show/hide only one row at a time, so I need help with...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.