Change button caption on continuous forms (1 Viewer)

aranj

Registered User.
Local time
Today, 02:01
Joined
Feb 18, 2003
Messages
44
I have a form, the view of which is continuous forms.
It has information on the left of the screen which the user is expected to manually match to information on the right, based on the suggestion of the underlying query (based on table a and table b)

E.g.

Client A $200 <button> Mr Smith $200.00
Client B $100 <button> Mr Smith $100.01

There is a button "match me" which when clicked runs an update query.

My query is how do I change the caption on the "match me" button to say "matched" just for the one that is clicked? Because it is a continuous form, if I use Command1.Caption = "Matched" or Me!Command1.Caption = "Matched" it changes it for all the buttons on the form.

Many thanks.
 

MarkK

bit cruncher
Local time
Yesterday, 19:01
Joined
Mar 17, 2004
Messages
8,177
This cannot be avoided. If you open your form in design view you'll notice there is only one button. When you change its caption, it is changed universally!
You can have different data in different subform records however, so if you can establish in a table or a query that a record is already matched, this field could be displayed on your form. In this situation, your button_Click handler can check the value of the field and warn that the item is already matched.
Cheers,
Mark
 

aranj

Registered User.
Local time
Today, 02:01
Joined
Feb 18, 2003
Messages
44
Thanks Mark.
 

worldofpies

New member
Local time
Yesterday, 19:01
Joined
Feb 2, 2016
Messages
1
Just in case anyone's found this via google, Here's a way to change button captions on continuous forms:
In my example I have a data field called 'Active' (boolean) that i want to use to change the button caption between "Hide" and "Unhide"

1. put a text box for the field 'Active' where i would like the button to be.
2. set its backcolor to grey (to match the button colour)
3. set its Special effect property to "raised" - now it looks like a button
4. set its control source to the function you want - i.e. =IIf([Active],"Hide","Unhide")
5. (you can also use conditional formatting to make the button text change colour formulaically)
6. Make a button with no caption and place it over the text box
7. use the Arrange menu to move it to the front
8. set the button's Back Style property to 'transparent'

now you've got something that does what you want :)

different users may have different skins on their copy of office.. to get round this, you might want to try a 3-layer approach.
Put a visible button at the back, put a transparent text box on top of that, finally add the transparent clickable button on top of them. this should follow the users skin style

j
 

Naphta

New member
Local time
Today, 03:01
Joined
Feb 5, 2016
Messages
1
hello england

we can also have different icons on buttons on a continuous forms

can do that with MSysResources table also

same technique but access 2007 required

there a complete sample on a french forum but i cannot write the link in this post
 

Prairieman

New member
Local time
Yesterday, 22:01
Joined
Nov 14, 2018
Messages
1
It is really pretty simple but a little dirty.
Simply make a text box that lies below the command button that will reflect the text you want the button to say. This can reflect any data difference that would require a different button caption for this line of the form so it is not a "change all" situation like the button caption property is. I create a new field in the query that provides the data to the continuous form and use an IIF statement in that field to determine a the text in the new field. In the form, I then lay the command button over the top of this text box, make the command button invisible and it works like a charm. You use the "Position" then "Send to Back" to get the text box under the command button. ;)
 

Users who are viewing this thread

Top Bottom