I am developing a new type of access db, using buttons to visulize on screen. Buttons have good propperty with colors and positions and so on. So I create a lot of buttons and make a name on eatch buttons and also make them unvisible. I can't make the button-name as an array like "button(I)" That would have been nice, but not possible. Next problem I still hope somebody can help me with. Making a button to hold a value. I try to hide the value in the .caption and then use it in a docmd.openform with a creteria. But vb will not have any of it. (Try with [] and val and so on) So labels and fields can hold a value, but not Buttons.... or is it a smart way anybod can help me with this ?? When I make the button visible, I also do some calculations I dont want to do again to find the value I am looking for.
Adam Schwanz
@Reply 12 months ago
Buttons cannot "hold" a value as they are just buttons, now you can put the text of a value into the caption of a button if thats what you mean... You can also display values from an array as the caption of buttons using VBA. But that's not storing anywhere, it's just display text.
Are you saying you want to be able to do like this?
DoCmd.OpenForm "CustomerF",,,"CustomerID=" & MyButton.Caption
Alex is right - you can temporarily store data in its Tag property. Or you can set a different variable, like a Global Var or a Temp Var, when you click the button. But a Command Button itself has no value. Now a Toggle Button, on the other hand, can be bound to a field.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visitor Forum.