Make a Clone Button

B

Bob

--

I want to make a clone command button for my form!
I want it to look like a normal Command button, but because I want the
caption to be a row source I have to artificially make one to look like the
others, any ideas





..........Jenny Vance
 
J

John Vinson

I want to make a clone command button for my form!
I want it to look like a normal Command button, but because I want the
caption to be a row source I have to artificially make one to look like the
others, any ideas

I have no clue what you mean here, Bob.

What does "caption to be a row source" mean???

You can dynamically set the Caption property of a textbox in a
suitable form event (e.g. Current to change the caption with each
record) - is that what you are trying to do?

John W. Vinson[MVP]
 
B

Bob

John I am trying to get the caption of a command button to copy what is in a
Text Box, Bearing in mind that text box could change what is in it!
Thanks bob
 
B

Bob

I have created List Boxes with the Click On to go where I want , but they a
messy and change colour when you click them and don't text align...thanks
Bob
 
J

John Vinson

John I am trying to get the caption of a command button to copy what is in a
Text Box, Bearing in mind that text box could change what is in it!

Not at all sure why you would want to do this - can't you just use the
click event OF THE TEXTBOX?

If you want this... you will need to put code in two places, the
Form's Current event and the textbox's AfterUpdate event. In both
cases:

Me!cmdMyButtonName.Caption = NZ(Me!textboxname, "Default Caption")


John W. Vinson[MVP]
 
J

JK

Bob,

I too not sure what you want to do.

If "clone" means identical copy of a Command Button:

In Form Design View:
- Select the button (click on it)
- Copy it (Edit Menu->Copy)
- Paste It ( Edit Menu->Paste)
- Drag the new (cloned) button to its position
- Change the properties of the "clone" as required

Is that what you wanted?

Regards
Jacob
(Flying on instruments ;-)
 
B

Bob

Ok Jacob :), I want something that looks like a Command Button but isn't,
Because I did not think by changing a Text Box that is linked to a Caption,
would change the Caption On the Command Button, But who am I to Know
;)....Regards Bob
 
J

JK

Bob,

If you want to change the caption of a Command Button to read the same as a
text Box:

In The Current Event of the form *and* in the AfterUpdate event of the Text
Box

Me.yrComandButton.Caption=Nz(Me.YrTextBox,"Some default")

Regards
Jacob
 
B

Bob

This is not right is it Jacob:
Private Sub Form_Current()
Me.Cbut1.Caption = Nz(Me.horsecb1, "Empty")

End Sub

Command button: Cbut1
Text Box: horsecb1
and if I had 10 of them on the form what would I have to put between them,
then?

Regards Bob
 
J

JK

That looks right to me Bob
Is it working? if not, do you gent an error or wrong results?

Jacob
 
A

AccessVandal via AccessMonster.com

Hi Bob,

Just curious, why create a command button when you can use Labels?
Labels may not have a clicking effect(a depression) but with labels, you can
make it look like a button.

Go the the Lable control properties Format - SpecialEffect = Raised.
You can use Margin properties to adjust the Text position also.

Than, use the AfterUpdate event to change the Label Caption property.
Ok Jacob :), I want something that looks like a Command Button but isn't,
Because I did not think by changing a Text Box that is linked to a Caption,
would change the Caption On the Command Button, But who am I to Know
;)....Regards Bob
[quoted text clipped - 14 lines]
Jacob
(Flying on instruments ;-)
 
B

Bob

What would I have to put in the label AfterUpdate to get the label Caption
from here:
SELECT TblHorseCB.ID, TblHorseCB.horsecb1 FROM TblHorseCB;
this is how my list box is getting its caption now
Thanks for helping Bob

AccessVandal via AccessMonster.com said:
Hi Bob,

Just curious, why create a command button when you can use Labels?
Labels may not have a clicking effect(a depression) but with labels, you
can
make it look like a button.

Go the the Lable control properties Format - SpecialEffect = Raised.
You can use Margin properties to adjust the Text position also.

Than, use the AfterUpdate event to change the Label Caption property.
Ok Jacob :), I want something that looks like a Command Button but isn't,
Because I did not think by changing a Text Box that is linked to a
Caption,
would change the Caption On the Command Button, But who am I to Know
;)....Regards Bob
[quoted text clipped - 14 lines]
Jacob
(Flying on instruments ;-)
 
A

AccessVandal via AccessMonster.com

It should be in the listbox AfterUpdate event.
If your name of Listbox is List2 than,

Private Sub List2_AfterUpdate()
Me.Label1.Caption = Me.List2.Column(1)
End Sub

Assuming Me.List2.Column(1) is TblHorseCB.horsecb1 and assuming Me.Label1 is
your Label Name.
Bob wrote:
What would I have to put in the label AfterUpdate to get the label Caption
from here:
SELECT TblHorseCB.ID, TblHorseCB.horsecb1 FROM TblHorseCB;
this is how my list box is getting its caption now
Thanks for helping Bob
[quoted text clipped - 19 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top