J
jo
Hi I would like to add a code to form that will close the form using the esc
button if required by the user?
Thanks
Jo
button if required by the user?
Thanks
Jo
jo said:Hi I would like to add a code to form that will close the form using the
esc
button if required by the user?
jo said:Hi Guys Ihave tried both ways and the form does not cancel when i use the
esc
button? What am I doing wrong??
Dirk Goldgar said:jo said:Hi Guys Ihave tried both ways and the form does not cancel when i use the
esc
button? What am I doing wrong??
Hmm. Both Peter and I essentially suggested the same thing, and it should
have worked if implemented correctly -- unless, of course, there's something
we don't know about the situation. Here are some questions for you:
When you say the form does not cancel, what exactly do you mean? Does
nothing at all happen? Do you get an error message or prompt? Does it
close, but save a record you don't want to save?
What is your form's name?
Is it a bound form or an unbound form; that is, does it have a Record
Source?
What is the name of the command button?
Is there a subform involved? If so, is the button on the main form or on
the subform? (It must be on the main form for this to work.)
What is the value of the command button's Cancel property?
What is the value of the command button's Visible property?
What is the value of the command button's On Click property? It should be
"[Event Procedure]" (without the quotes).
What is the code for the command button's Click event procedure?
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Dirk Goldgar said:jo said:Hi Guys Ihave tried both ways and the form does not cancel when i use the
esc
button? What am I doing wrong??
Hmm. Both Peter and I essentially suggested the same thing, and it should
have worked if implemented correctly -- unless, of course, there's something
we don't know about the situation. Here are some questions for you:
When you say the form does not cancel, what exactly do you mean? Does
nothing at all happen? Do you get an error message or prompt? Does it
close, but save a record you don't want to save?
What is your form's name?
Is it a bound form or an unbound form; that is, does it have a Record
Source?
What is the name of the command button?
Is there a subform involved? If so, is the button on the main form or on
the subform? (It must be on the main form for this to work.)
What is the value of the command button's Cancel property?
What is the value of the command button's Visible property?
What is the value of the command button's On Click property? It should be
"[Event Procedure]" (without the quotes).
What is the code for the command button's Click event procedure?
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
jo said:Right what I have is a form that is not bound, I have labels that when you
click on them they open others forms or dialogs. I call it my floating
menu
it just looks like a button with text on it.
I just tried both of your ideas and nothing work or came up as an error? I
put a command button on the form and done as you both suggested and I put
the
code on the button's click event and changed the cancel yes?
There are no subforms, no record source..
jo said:Hi Clifford I done as you suggested and made the button command visible
and
when click or use the ESC button I get a Complie Error saying Method or
Dta
member not found. At it highlights the form's name FLOATER.
The code i have there is:
Private Sub cmdClose_Click()
DoCmd.Close acForm, Me.FLOATER, acSaveNo
End Sub