Command button, close form

samgfi

New member
Local time
Yesterday, 18:04
Joined
Jul 15, 2009
Messages
7
Hey

I have a form which allows data to be added to a table, but i also want a command button which will shut the form but not add the data put into the form, onto the table that it is related to.

at the moment i have a command button with a macro that shuts the form down but still adds any information typed in text boxes to the table.


sam
 
Generally speaking, on a data entry style form, the data is entered into the table as soon as you type it onto the form.

The only way I can think of to do what you wish would be to create ghost fields in your form.
You would then have to create a save button to actually save the entered data into the form.
Example:
For an entry form for a mailing table, you would have 5 textboxes on your form. You would enter the persons first and last name, address, city, prov or state and postal code (zip).
You would then click the save button that would be coded to save Text1 as FirstName, Text2 as LastName etc.
If you click the Close Form button, no data would be saved.
 
If I am understanding you correctly, you could probably get away with adding a SendKeys action into your macro before the close. Send the {ESC} key.

In most cases, when you type data into a form the data isn't actually saved until you leave the record (or save the record). Pushing the Escape key voids all unsaved changes on that record.

Macro: btnExitWithoutSaving

Action: SendKeys Keystrokes: {ESC} Wait: Yes
Action: Close Object Type: Form Object Name: frmYourForm Save: No
 

Users who are viewing this thread

Back
Top Bottom