When close form record saves

Osix

Registered User.
Local time
Today, 21:53
Joined
Feb 3, 2011
Messages
19
If a have filled form and I want just close form record saves in table, why?
How can to dispose it?
I just want that form closes and record removes.
 
That is by design. If you want to cancel the changes then create a Cancel Button and put Me.UnDo in it.
 
or use an unbound form.

why would you NOT want a record to save?
 
I'm sorry Dave but I have only seen one situation where an unbound form made sense.
 
I have to agree with Allan! A big part of the reason to use Access for database development is the speed with which it can be created, using bound forms. Several developers I know, experienced in both Visual Basic and Access database development, estimate that development using unbound forms by experienced developers takes two to three times as long as it does when using Access and bound forms. You simply spend too much time constantly re-inventing the wheel.

If you insist on using unbound forms, you'd be far better off using a straight VB or C++ front end with a SQL Server or Oracle back end.
  • You can create an EXE file which gives total protection to your code/design
  • You can distribute the db to PCs without a copy of Access being on board
  • Your data security if far, far better than anything you can do in Access

Trying to reinvent the way Access is intended to work becomes a problem with experienced Access data input users. They know that Access saves records when moving to another record or when the form is closed, and expect this behavior. It's a better policy to allow Access to work in its native way and merely check with the user before the record is saved, allowing them to save it or dump the new record or changes. This piece of code will do just that

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not (Me.NewRecord) Then
 If MsgBox("Would You Like To Save The Changes To This Record?", vbQuestion + vbYesNo + vbDefaultButton1, "Save Changes to Record ???") = vbNo Then
  Me.Undo
 End If
Else
 If MsgBox("Would You Like To Save This New Record?", vbQuestion + vbYesNo + vbDefaultButton1, "Save This Record ???") = vbNo Then
  Me.Undo
 End If
End If
End Sub
Linq ;0)>
 
I'm sorry Dave but I have only seen one situation where an unbound form made sense.

I dont often use unbound forms either - but if the OP doesnt want the data that was input, then an unbound form just seemed to be a solution.
 
Last edited:
From the original question the OP is obviously a newbie, and has no real training in Access. Unbound forms are the last thing he should trying to use.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom