By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

How to change button name in subform independent

100+
P: 222
Dear friend

Using access 2007 sp2.

I have a continuous subform. I have been creating a button on the detail area. I need to change for each record the caption of the button.

Is that possible to do it independent.

Here is an example

For record 1 button caption name = "1"
For record 2 button caption name = "2"
For record 3 button caption name = "3"

thank you in advance

regards
May 7 '10 #1

✓ answered by Jim Doherty

@wassimdaccache
Hi

Depending on your design and if I am reading you correctly (ie you dont edit in this textbox) then set the textbox tabstop property of the textbox to 'No' and locked = 'Yes'. Place a button over the text box setting its transparent property to Yes. Place any command you might have in the buttons event. That way you see whatever is in the textbox 'through' the command button but whenever they click what they might think is the textbox, it is in actual fact the button.

Share this Question
Share on Google+
7 Replies


missinglinq
Expert 2.5K+
P: 3,532
Not on a Continuous View Form. The caption of the button on the current form would be the caption of the button on all records.

What is the purpose of this rather odd requirement?

Linq ;0)>
May 8 '10 #2

100+
P: 222
It is a matter of design.

On the form invoice I have a subform (Item List) for each record on the subform exist a textbox. When user click on the textbox the item will be added on the invoice.

The problem is when user is clicking on the textbox it will select all the text inside and the mouse will change the shape as for adding or editing a text because it is a textbox...

User is using a touchable screen...

Can we change a textbox design to a button ?

Regards
May 8 '10 #3

Jim Doherty
Expert 100+
P: 897
@wassimdaccache
Hi

Depending on your design and if I am reading you correctly (ie you dont edit in this textbox) then set the textbox tabstop property of the textbox to 'No' and locked = 'Yes'. Place a button over the text box setting its transparent property to Yes. Place any command you might have in the buttons event. That way you see whatever is in the textbox 'through' the command button but whenever they click what they might think is the textbox, it is in actual fact the button.
May 8 '10 #4

NeoPa
Expert Mod 15k+
P: 31,308
No. It's not possible. See Why Values in Unbound Form Controls do not Persist.

However, why not do something very similar to what Jim suggests? You'd need the data you want to show to be bound somewhere of course, but if you had the data available in a bound control you could simply handle the Click even of that control. A transparent button over the top is a technique that would also work of course. Without a bound control available though, any assignment of a value to the control would change every occurrence of that control, which would not be helpful to you of course.
May 8 '10 #5

P: 15
I agree this is a huge problem with Access continuous forms. It's been a problem from the very beginning so I don't know if Microsoft will ever fix it.

The one thing I've done is use expressions in the continuous form so that the value is what you want the user to see for each record. You can then put a button next to it with a "..." caption and it's pretty intuitive.
May 9 '10 #6

NeoPa
Expert Mod 15k+
P: 31,308
I don't see this as a problem at all. It is perfectly logical but it does tend to force proper database design on the database. If a database is properly designed this won't be an issue.
May 9 '10 #7

100+
P: 222
i place a button over the text box setting its transparent property to Yes and now user is not able to select the data on the text box. I copied the code from the text box to the button.

I lost the effect of the button but it is not a problem i got what i wanted...

thanks again
May 9 '10 #8

Post your reply

Sign in to post your reply or Sign up for a free account.