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
|
|||
|
|||
Show/Hide Combo box
Hi Guys,
Does anyone know the syntax to hide a combo box on a form if it is opened in edit mode? I am not sure if I should hide the combo by default and make visible in 'Add' mode or to leave it visible and hide in 'edit' mode. I am using the MS switchboard to control form access, I am assuming it will be on the forms 'onLoad' event ? Regards Si Access 2007 |
#2
|
|||
|
|||
Show/Hide Combo box
Controls on a form have properties. One of the properties is the .Visible
property... another is the .Enabled property. Users sometimes get nervous when things disappear ... consider using ..Enabled to enable/disable the control, rather than disappearing it. When you switch to "edit mode", how are you doing that? If you have a command button, you could add code to that control to change the .Enabled (or .Visible) property. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "SimonT" wrote in message ... Hi Guys, Does anyone know the syntax to hide a combo box on a form if it is opened in edit mode? I am not sure if I should hide the combo by default and make visible in 'Add' mode or to leave it visible and hide in 'edit' mode. I am using the MS switchboard to control form access, I am assuming it will be on the forms 'onLoad' event ? Regards Si Access 2007 |
#3
|
|||
|
|||
Show/Hide Combo box
Hi Jeff,
Thanks for that. As I mentioned I have a switchboard form that has buttons to select a form to open, this particular form can choose from: 1 opens form in add mode 2 opens form in edit mode So what I want is if the user is to add and record, the combo box is not visible, (The combo box is only used to locate a record on the form, so it only required in edit mode) Regards Si "Jeff Boyce" wrote in message ... Controls on a form have properties. One of the properties is the .Visible property... another is the .Enabled property. Users sometimes get nervous when things disappear ... consider using .Enabled to enable/disable the control, rather than disappearing it. When you switch to "edit mode", how are you doing that? If you have a command button, you could add code to that control to change the .Enabled (or .Visible) property. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "SimonT" wrote in message ... Hi Guys, Does anyone know the syntax to hide a combo box on a form if it is opened in edit mode? I am not sure if I should hide the combo by default and make visible in 'Add' mode or to leave it visible and hide in 'edit' mode. I am using the MS switchboard to control form access, I am assuming it will be on the forms 'onLoad' event ? Regards Si Access 2007 |
#4
|
|||
|
|||
Show/Hide Combo box
Hopefully one of the other readers can help. My last use of the Switchboard
feature was many years ago. (If I had to think up a work-around, I might use code in the form's OnOpen event that checked whether it was being opened for Edit or Add, then modify the combobox's .Visible or .Enabled property...) Good luck! Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "SimonT" wrote in message ... Hi Jeff, Thanks for that. As I mentioned I have a switchboard form that has buttons to select a form to open, this particular form can choose from: 1 opens form in add mode 2 opens form in edit mode So what I want is if the user is to add and record, the combo box is not visible, (The combo box is only used to locate a record on the form, so it only required in edit mode) Regards Si "Jeff Boyce" wrote in message ... Controls on a form have properties. One of the properties is the .Visible property... another is the .Enabled property. Users sometimes get nervous when things disappear ... consider using .Enabled to enable/disable the control, rather than disappearing it. When you switch to "edit mode", how are you doing that? If you have a command button, you could add code to that control to change the .Enabled (or .Visible) property. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "SimonT" wrote in message ... Hi Guys, Does anyone know the syntax to hide a combo box on a form if it is opened in edit mode? I am not sure if I should hide the combo by default and make visible in 'Add' mode or to leave it visible and hide in 'edit' mode. I am using the MS switchboard to control form access, I am assuming it will be on the forms 'onLoad' event ? Regards Si Access 2007 |
#5
|
|||
|
|||
Show/Hide Combo box
"SimonT" wrote in message
... Hi Guys, Does anyone know the syntax to hide a combo box on a form if it is opened in edit mode? I am not sure if I should hide the combo by default and make visible in 'Add' mode or to leave it visible and hide in 'edit' mode. I am using the MS switchboard to control form access, I am assuming it will be on the forms 'onLoad' event ? You could use the form's Load event to check whether its recordset is empty. That's not quite the same as knowing whether it was opened in add mode, because you might just be opening it on an empty table, or a query that returns no records. However, it might be good enough for your purposes. '----- start of example code ----- Private Sub Form_Load() Me.cboMyComboBox.Visible = _ (Me.Recordset.RecordCount 0) End Sub '----- end of example code ----- -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|