If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
"Invisible" Control Unhides Itself on All Records
I created a control (cboProd_Testing) that is supposed to be invisible until
a specific value (2 for "Application Error") is selected in another combo box on the form (cboCategory). When I go to a record and select Application Error, the cboProd_Testing appears. The trouble is that it appears on all records, not just those on which Application Error is selected. Using info I found here, I put the following code in the After Update event of cboCategory (see line 3) (the requery is for another combo): Private Sub cboCategory_AfterUpdate() cboDescription.Requery 'cboProd_Testing is visible when cboCategory = Application Error. Me![cboProd_Testing].Visible = (Me.cboCategory = 2) End Sub Can anyone offer any suggestions for what to do? -- susan |
#2
|
|||
|
|||
A couple of possible problems. 1) If the first combo box is unbound, then
moving from one record to the next won't change its value. You may need to do some work in the form's Current event to reset things. 2) You have the form in Continuous Form view. For this, instead of hiding/unhiding the control you may want to use Conditional Formatting. In form design view, right click the second combo box and choose Conditional Formatting. Set if for Expression and type the expression cboCategory = 2 Next, adjust the fore and back colors to make it appear that the control is visible/invisible instead of actually changing the visible property of the control. The problem is the control will still be there if the user clicks in the correct place or if the control is in the tab order, so you'll also need to enable/disable and lock/unlock the control in the form's Current event so that when you are on a record that you should have access to the second combo box you can, but it will be disabled and locked when you are on a record that it shouldn't be visible. -- Wayne Morgan MS Access MVP "Susan L" wrote in message ... I created a control (cboProd_Testing) that is supposed to be invisible until a specific value (2 for "Application Error") is selected in another combo box on the form (cboCategory). When I go to a record and select Application Error, the cboProd_Testing appears. The trouble is that it appears on all records, not just those on which Application Error is selected. Using info I found here, I put the following code in the After Update event of cboCategory (see line 3) (the requery is for another combo): Private Sub cboCategory_AfterUpdate() cboDescription.Requery 'cboProd_Testing is visible when cboCategory = Application Error. Me![cboProd_Testing].Visible = (Me.cboCategory = 2) End Sub Can anyone offer any suggestions for what to do? -- susan |
#3
|
|||
|
|||
Susan,
I take it you're referring to a single form... but the principle applies to continuous also. In addition to the code that hides/shows cboProd_testing on the AfterUpdate event of ApplicationError... use the OnCurrent event of the form to test for a 2 in ApplicationError, and hide/show cboProd_Testing accordingly. hth Al Camp "Susan L" wrote in message ... I created a control (cboProd_Testing) that is supposed to be invisible until a specific value (2 for "Application Error") is selected in another combo box on the form (cboCategory). When I go to a record and select Application Error, the cboProd_Testing appears. The trouble is that it appears on all records, not just those on which Application Error is selected. Using info I found here, I put the following code in the After Update event of cboCategory (see line 3) (the requery is for another combo): Private Sub cboCategory_AfterUpdate() cboDescription.Requery 'cboProd_Testing is visible when cboCategory = Application Error. Me![cboProd_Testing].Visible = (Me.cboCategory = 2) End Sub Can anyone offer any suggestions for what to do? -- susan --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.791 / Virus Database: 535 - Release Date: 11/8/2004 |
#4
|
|||
|
|||
Al and Wayne: Thanks ever so much for your responses and advice. I decided to
try Al's suggestion first, and it worked like a charm. But I've put Wayne's conditional formatting suggestion in my Access Tips database. I had not thought of using conditional formatting that way. Creative! Thanks so much again! "AlCamp" wrote: Susan, I take it you're referring to a single form... but the principle applies to continuous also. In addition to the code that hides/shows cboProd_testing on the AfterUpdate event of ApplicationError... use the OnCurrent event of the form to test for a 2 in ApplicationError, and hide/show cboProd_Testing accordingly. hth Al Camp "Susan L" wrote in message ... I created a control (cboProd_Testing) that is supposed to be invisible until a specific value (2 for "Application Error") is selected in another combo box on the form (cboCategory). When I go to a record and select Application Error, the cboProd_Testing appears. The trouble is that it appears on all records, not just those on which Application Error is selected. Using info I found here, I put the following code in the After Update event of cboCategory (see line 3) (the requery is for another combo): Private Sub cboCategory_AfterUpdate() cboDescription.Requery 'cboProd_Testing is visible when cboCategory = Application Error. Me![cboProd_Testing].Visible = (Me.cboCategory = 2) End Sub Can anyone offer any suggestions for what to do? -- susan --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.791 / Virus Database: 535 - Release Date: 11/8/2004 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Edit properties of linked subforms problem (repost) | Allen Browne | Using Forms | 3 | November 12th, 2004 08:16 PM |
Unmatched Query Mess | Natalia | Running & Setting Up Queries | 8 | October 28th, 2004 02:36 PM |
open a form through a subform in access 2000 | Tammy | Setting Up & Running Reports | 12 | October 22nd, 2004 02:43 PM |
How can I move the focus to a control on a subform? | Brandon | General Discussion | 7 | July 17th, 2004 01:39 AM |
Restricting entries in a ComboBox | tina | General Discussion | 5 | June 14th, 2004 05:13 PM |