dbTalk Databases Forums  

Unbound control caption

comp.databases.ms-access comp.databases.ms-access


Discuss Unbound control caption in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
WhathaveIdone?
 
Posts: n/a

Default Unbound control caption - 09-03-2010 , 12:50 PM






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?

Reply With Quote
  #2  
Old   
James A. Fortune
 
Posts: n/a

Default Re: Unbound control caption - 09-03-2010 , 01:52 PM






On Sep 3, 1:50*pm, "WhathaveIdone?" <brasu... (AT) gmail (DOT) com> wrote:
Quote:
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?,

Quote:
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
CDMAPoster (AT) FortuneJames (DOT) com

Reply With Quote
  #3  
Old   
Eggs
 
Posts: n/a

Default Re: Unbound control caption - 09-03-2010 , 03:42 PM



On Sep 3, 11:52*am, "James A. Fortune" <CDMAPos... (AT) FortuneJames (DOT) com>
wrote:
Quote:
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:
Quote:
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

Reply With Quote
  #4  
Old   
WhathaveIdone?
 
Posts: n/a

Default Re: Unbound control caption - 09-03-2010 , 04:33 PM



On Sep 3, 2:42*pm, Eggs <eggi... (AT) yahoo (DOT) com> wrote:
Quote:
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?

Reply With Quote
  #5  
Old   
James A. Fortune
 
Posts: n/a

Default Re: Unbound control caption - 09-04-2010 , 08:03 PM



On Sep 3, 5:33*pm, "WhathaveIdone?" <brasu... (AT) gmail (DOT) com> wrote:
Quote:
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?
I see now. Those HTML controlbox style thingies :-). For some
reason, I just couldn't understand what the OP was talking about.
Sometimes you have to think INSIDE the box :-).

J. A. Fortune
CDMAPoster (AT) FortuneJames (DOT) com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.