![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Am I missing something really simple? I feel like I should be able to find this and I haven't seen anything on it yet. I have several unbound controls (2 text boxes, 3 combo boxes) for use as a search form. I want to be able to add a caption to these boxes so I didn't have to use the label. The caption would, of course, need to go away when the control has focus. There will be no calculations or anything. They are just fields used to filter the current form. *If this is just not possible, then no problem, if it is, please help me understand what I am missing or if you have an idea on how to do that. Thanks, y'all! -WhathaveIdone? |
|
I want to be able to add a caption to these boxes so I didn't have to use the label. The caption would, of course, need to go away when the control has focus. |
#3
| |||
| |||
|
|
On Sep 3, 1:50*pm, "WhathaveIdone?" <brasu... (AT) gmail (DOT) com> wrote: Am I missing something really simple? I feel like I should be able to find this and I haven't seen anything on it yet. I have several unbound controls (2 text boxes, 3 combo boxes) for use as a search form. I want to be able to add a caption to these boxes so I didn't have to use the label. The caption would, of course, need to go away when the control has focus. There will be no calculations or anything. They are just fields used to filter the current form. *If this is just not possible, then no problem, if it is, please help me understand what I am missing or if you have an idea on how to do that. Thanks, y'all! -WhathaveIdone? Whatareyoutryingtodo?, I want to be able to add a caption to these boxes so I didn't have to use the label. The caption would, of course, need to go away when the control has focus.. Are you talking about controls on a subform, where an associated label's caption is going to show up like a field name on a main form? Labels, in general, work great for unbound controls on search forms. The Caption and Visible properties allow you to change the caption (I have found that it usually helps to have a DoEvents right after the property change) and show or hide the label dynamically. *Maybe you can reword your question so that everyone can understand what you mean by a caption for your controls that is not a label. *Why do you need to hide the label when the control has focus? James A. Fortune CDMAPos... (AT) FortuneJames (DOT) com |
|
Am I missing something really simple? I feel like I should be able to find this and I haven't seen anything on it yet. I have several unbound controls (2 text boxes, 3 combo boxes) for use as a search form. I want to be able to add a caption to these boxes so I didn't have to use the label. The caption would, of course, need to go away when the control has focus. There will be no calculations or anything. They are just fields used to filter the current form. *If this is just not possible, then no problem, if it is, please help me understand what I am missing or if you have an idea on how to do that. Thanks, y'all! -WhathaveIdone? |
#4
| |||
| |||
|
|
On Sep 3, 11:52*am, "James A. Fortune" <CDMAPos... (AT) FortuneJames (DOT) com wrote: On Sep 3, 1:50*pm, "WhathaveIdone?" <brasu... (AT) gmail (DOT) com> wrote: Am I missing something really simple? I feel like I should be able to find this and I haven't seen anything on it yet. I have several unbound controls (2 text boxes, 3 combo boxes) for use as a search form. I want to be able to add a caption to these boxes so I didn't have to use the label. The caption would, of course, need to go away when the control has focus. There will be no calculations or anything.. They are just fields used to filter the current form. *If this is just not possible, then no problem, if it is, please help me understand what I am missing or if you have an idea on how to do that. Thanks, y'all! -WhathaveIdone? Whatareyoutryingtodo?, I want to be able to add a caption to these boxes so I didn't have to use the label. The caption would, of course, need to go away when the control has focus. Are you talking about controls on a subform, where an associated label's caption is going to show up like a field name on a main form? Labels, in general, work great for unbound controls on search forms. The Caption and Visible properties allow you to change the caption (I have found that it usually helps to have a DoEvents right after the property change) and show or hide the label dynamically. *Maybe you can reword your question so that everyone can understand what you mean by a caption for your controls that is not a label. *Why do you need to hide the label when the control has focus? James A. Fortune CDMAPos... (AT) FortuneJames (DOT) com I think what is meant that the "caption" is the initial value of the field as a sort of prompt like "Enter Acct# Here" that would disappear when the user clicked or tabbed to it to enter data, so, if I'm right about that, then this code would work: On Sep 3, 10:50*am, "WhathaveIdone?" <brasu... (AT) gmail (DOT) com> wrote: Am I missing something really simple? I feel like I should be able to find this and I haven't seen anything on it yet. I have several unbound controls (2 text boxes, 3 combo boxes) for use as a search form. I want to be able to add a caption to these boxes so I didn't have to use the label. The caption would, of course, need to go away when the control has focus. There will be no calculations or anything. They are just fields used to filter the current form. *If this is just not possible, then no problem, if it is, please help me understand what I am missing or if you have an idea on how to do that. Thanks, y'all! -WhathaveIdone? Add code like this to your form: Private Sub_Form_Open(Cancel as Integer) * 'Set the initial focus to something that doesn't have a caption * Me.Command0.SetFocus * Me.ThisTextBox = "Enter data here" End Sub Private Sub ThisTextBox_GotFocus * If Me.ThisTextBox = "Enter data here" then * * *Me.ThisTextBox = Null * End If End Sub |
#5
| |||
| |||
|
|
On Sep 3, 2:42*pm, Eggs <eggi... (AT) yahoo (DOT) com> wrote: On Sep 3, 11:52*am, "James A. Fortune" <CDMAPos... (AT) FortuneJames (DOT) com wrote: On Sep 3, 1:50*pm, "WhathaveIdone?" <brasu... (AT) gmail (DOT) com> wrote: Am I missing something really simple? I feel like I should be able to find this and I haven't seen anything on it yet. I have several unbound controls (2 text boxes, 3 combo boxes) for use as a search form. I want to be able to add a caption to these boxes so I didn't have to use the label. The caption would, of course, need to go away when the control has focus. There will be no calculations or anything. They are just fields used to filter the current form. *If this is just not possible, then no problem, if it is, please help me understand what I am missing or if you have an idea on how to do that. Thanks, y'all! -WhathaveIdone? Whatareyoutryingtodo?, I want to be able to add a caption to these boxes so I didn't have to use the label. The caption would, of course, need to go away when the control has focus. Are you talking about controls on a subform, where an associated label's caption is going to show up like a field name on a main form? Labels, in general, work great for unbound controls on search forms. The Caption and Visible properties allow you to change the caption (I have found that it usually helps to have a DoEvents right after the property change) and show or hide the label dynamically. *Maybe you can reword your question so that everyone can understand what you mean by a caption for your controls that is not a label. *Why do you need to hide the label when the control has focus? James A. Fortune CDMAPos... (AT) FortuneJames (DOT) com I think what is meant that the "caption" is the initial value of the field as a sort of prompt like "Enter Acct# Here" that would disappear when the user clicked or tabbed to it to enter data, so, if I'm right about that, then this code would work: On Sep 3, 10:50*am, "WhathaveIdone?" <brasu... (AT) gmail (DOT) com> wrote: Am I missing something really simple? I feel like I should be able to find this and I haven't seen anything on it yet. I have several unbound controls (2 text boxes, 3 combo boxes) for use as a search form. I want to be able to add a caption to these boxes so I didn't have to use the label. The caption would, of course, need to go away when the control has focus. There will be no calculations or anything.. They are just fields used to filter the current form. *If this is just not possible, then no problem, if it is, please help me understand what I am missing or if you have an idea on how to do that. Thanks, y'all! -WhathaveIdone? Add code like this to your form: Private Sub_Form_Open(Cancel as Integer) * 'Set the initial focus to something that doesn't have a caption * Me.Command0.SetFocus * Me.ThisTextBox = "Enter data here" End Sub Private Sub ThisTextBox_GotFocus * If Me.ThisTextBox = "Enter data here" then * * *Me.ThisTextBox = Null * End If End Sub That was EXACTLY what I was looking for, Eggs! Thank you so much! I knew it had to be something simple. It works great! -WhathaveIdone? |
![]() |
| Thread Tools | |
| Display Modes | |
| |