State of a button

  • Thread starter Thread starter Mark A. Sam
  • Start date Start date
M

Mark A. Sam

Hello,

Is there a method to read the State of a depressed button? I am needing to
bypass a section in a forms current event when a record is deleted, and want
to do it by reading the state of the Delete button rather than setting a
variable.

Thanks.

Mark A. Sam
 
You talking about a toggle button? Me.tglButton = 0 if it's up, -1 if it's
down. unless its TripleState property has been set to Yes, in which case it
can also have a value of Null.
 
Doug,

No a command button. I wrote a function to handle it now, but I would still
be able to know if it the command button's state can be read. This would be
while the click event is firing.

I my situation I am deleting a record, so I click the button, it runs the
Docmd.DeleteRecord command. First the Delete Event fires, next the Current
Event fires. There is code in the Current event that gives me errors during
the delete process, so I am bypassing it. I thought that testing the state
of the command button would be better than setting a variable and writing a
function. Not that it is a big deal to write the function, becuase I did
that, but I wanted to know. I don't think it is possible.

God Bless,

Mark
 
I don't believe command buttons have a state.

Maybe you can set a global variable in the Button_Click event, and read it
in the Form_Current event.
 
Thanks Doug, I did that.


Douglas J. Steele said:
I don't believe command buttons have a state.

Maybe you can set a global variable in the Button_Click event, and read it
in the Form_Current event.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



would writing setting
 
Back
Top