Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a new record with only default values

Status
Not open for further replies.

vgeng

Technical User
Feb 5, 2003
15
BE

When my forms open, it will open a new record and
fills all values (user-id + timestamp) automatically.

when the user closes the form by clicking on it,
Access 97 doesn't recognize the record as a new one
because now values are changed, so it doesn't save it.

does anyone have a solution ?

thanks

G
 
you can try this, remove the ability to close the form using the close button in the Control Box at the top of the Form. Create a command button to close the form, and prompt the user on whether or not they want to save the data. If yes, then DoCmd.RunCommand accmdSaveRecord, otherwise exit.

PaulF
 
You could use the same principle as PaulF but instead of disabling the button have the save prompt on the Form_Unload event. You can also set the Cancel parameter to stop the form being closed.

Hope this helps

Harleyquinn

---------------------------------
For tsunami relief donations
 

I'm sorry guys, but i'm afraid this won't work
Because the user didn't introduce any field
himself, access thinks he hasn't something to save
and disregard the saverecord command completely

G
 
In the Form_QueryUnload event add a space to a text box then delete it. You can then use the Cancel parameter and save the form or not as needed.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'If we're supposed to work in Hex, why have we only got A fingers?'
Essex Steam UK for steam enthusiasts
 
It works !!!!

Thank you all for your help

G
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top