exit a form without it saving the info entered to table

xena_morph

Registered User.
Local time
Today, 14:16
Joined
Jul 8, 2000
Messages
37
is it possible if youve filled part of a form in and change your mind to exit the form without it being saved to the table
 
use me.undo to undo any changes to the form, or see the button wizard for an Undo button in record operations.

jennifer
 
i ve been trying to do it with the

other > cancel set to yes but am not sure how to set up the acro to ensure it deletes whats added.

im not sure how to use the me.undo and cant seem to get the biutton wizard on argh
 
why can't you get your button wizard on?

here is the code from behind a button wizard Undo button. you can just make a new command button and then make this the click event.

Private Sub cmdUndo_Click()
On Error GoTo Err_cmdUndo_Click

'undoes any changes that have been made
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

Exit_cmdUndo_Click:
Exit Sub

Err_cmdUndo_Click:
MsgBox Err.Description
Resume Exit_cmdUndo_Click

End Sub

jennifer
 
finally got button wizard to work which is brill
but was wanting to put macro on it to also exit as well as undo, it seems i can only get it to do one or the other not both by clicking the one button with the following macro:

openform
close
close
 
it would be easier to just go into the code for the button click and docmd.close, yes?
if exiting the form on undo is what you want?

[This message has been edited by JCross (edited 03-13-2002).]
 
not to sound too stupid but i dont know where in the coding that would go, could you please indicate where,

many thanks
 
yeah i actually think ive figured out where it goes yeah!!!! problem is the table is still open behind it like
 
what do you mean that the table is still open behind it. and if you go into the properties for the button, on the events tab, the on click event....then open up the code builder through the button on the right on the box it takes you the right place in the code.

jennifer
 
i mean i click on the button to undo what is done on the form with the intention of also exiting at the same time but becuase the table was opened behind it originally to allow the form to store the info in it , it stays open on top
 
I have absolutely no idea why you have the table open at all. It doesn't have to be 'open' to do anything with it. When you create a program to give to users, the whole purpose behind making forms is so that they don't have any access to the tables directly - and normally you would even hide the database window from them. Why is your table open?

[This message has been edited by JCross (edited 03-14-2002).]
 
its open because every time i dont include it but have the function gotorecord -> new on it it wont work unless i havent got the table open in the background but then again at the moment it wont go to a new record fullstop
 
have to admit i have no idea why gotorecord would need the table open. makes no sense to me. hopefully someone else will have an answer for you!

jen

[This message has been edited by JCross (edited 03-14-2002).]
 

Users who are viewing this thread

Back
Top Bottom