Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 9th, 2003, 03:58 AM
Authorized User
 
Join Date: Jun 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access Bound forms - auto saving data!

Is it possible to stop Access automatically saving data when you navigate through your records using <next record>, <prev record> buttons on a Bound form? I'm using bound forms to write back to an SQL Server database, but I do not want this to happen automatically. I'm hoping that I do not have to control this using unbound forms! It means a lot more coding!!
 
Old September 9th, 2003, 08:31 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can set the form properties to AllowEdits: NO. Then when you do wish to Edit the form, you will need a button to change the form properties to AllowEdits: Yes.

Regards,

Beth M
 
Old September 9th, 2003, 11:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Quote:
quote:Originally posted by BethMoffitt
 You can set the form properties to AllowEdits: NO. Then when you do wish to Edit the form, you will need a button to change the form properties to AllowEdits: Yes.
 Correct me if I'm wrong, but it's not that JScully doesn't want to allow edits. That is desired. It's that he/she doesn't want Access to save any edits until desired. AllowEdit should be set to YES, but there's no AutoSave OFF or NO option.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old September 9th, 2003, 11:58 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Good point Greg. But, if they did wish the recordset to be Read Only unless a certain criteria was met (say permission level) then the AllowEdits No would do the trick.

Beth M
 
Old January 17th, 2005, 02:58 PM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can't find the autosave property and would like to control bound forms more precisely. I think a user should have the ability to indicate when an update or insert takes place through clicking a button and the autosave property sounds like my answer. Could you tell me how to find it. I assume it is a property of the form but it doesn't seem to be listed in the properties box.

 
Old January 17th, 2005, 07:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Another way to go might be to ask the user if they want to save changes to the current record or not:

Private Sub Form_BeforeUpdate(Cancel As Integer)
    Dim strResponse As String

    If Me.Dirty Then
        Select Case MsgBox( _
            Prompt:="This record has been changed" & _
                vbCrLf & "Do you want to save?", _
            Buttons:=vbExclamation Or vbYesNo)
        Case vbYes
            'Save changes to current record before advancing
            'to next record.
            DoCmd.RunCommand acCmdSave
        Case vbNo
            'Discard changes to current record before advancing
            'to next record.
            DoCmd.RunCommand acCmdUndo
        End Select
    End If
End Sub

HTH,

Bob

 
Old January 17th, 2005, 07:09 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Oops...can loose the Dim strResponse As String declaration. Didn't use it after all.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving textbox data into Access iostream212 VB Databases Basics 0 July 20th, 2008 09:58 AM
importing excel data into access forms navdeepsinghparmar Access 1 November 7th, 2007 01:27 PM
Saving forms rgerald Access 3 April 5th, 2006 11:55 AM
Data in Word forms in Access Tables HowardB Access VBA 1 January 9th, 2004 09:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.