If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Basic Tables Question
I have Access 2003. It seems when I change a record, and go to close the
sheet, there is no prompt asking me if I want to save the changes or cancel, which is certainly standard in Excel and Word. Is this by design? If so, is there any way to make it prompt? It seems it might be a problem if I change a record by mistake. Thanks. Chuck |
#2
|
|||
|
|||
Basic Tables Question
This is by design. As each record is edited it is posted back to the
database. The developer can build a prompt when the 'onupdate' event fires and/or can add appropriate field validation values to the application. However, these should be used in a manner to make sure the user experience is still appropriate. Ed Warren. "Chuck Hildebrandt" wrote in message m... I have Access 2003. It seems when I change a record, and go to close the sheet, there is no prompt asking me if I want to save the changes or cancel, which is certainly standard in Excel and Word. Is this by design? If so, is there any way to make it prompt? It seems it might be a problem if I change a record by mistake. Thanks. Chuck |
#3
|
|||
|
|||
Basic Tables Question
"Chuck Hildebrandt" wrote in message
m... I have Access 2003. It seems when I change a record, and go to close the sheet, there is no prompt asking me if I want to save the changes or cancel, which is certainly standard in Excel and Word. Is this by design? If so, is there any way to make it prompt? It seems it might be a problem if I change a record by mistake. That's the was Access is. What I do is to create a form used for Add mode only with all unbound fields then when an update button is pressed, I add the contents of the fields to the table. If the Cancel button is pressed no update occurs. It's more work but it is a lot safer. Tom Lake |
#4
|
|||
|
|||
Basic Tables Question
That's the BeforeUpdate event, not onupdate. The BeforeUpdate event should
be cancelled if any errors are detected or if you prompt the user and he says not to save. Use: Cancel = True to cancel the BeforeUpdate event. You can use .SetFocus to set focus back to a control that needs correcting and you can use MsgBox to display messages. For example: Private Sub Form_BeforeUpdate (Cancel As Integer) If IsNull(Me.SomeField) Then MsgBox "Some Field may not be null", vbOKOnly Cancel = True Me.SomeField.SetFocus End If If Me.SomeDate Date() + 7 Then MsgBox "Some Date must not be more than one week in the future", vbOKOnly Cancel = True Me.SomeDate.SetFocus End If End Sub "Ed Warren" wrote in message ... This is by design. As each record is edited it is posted back to the database. The developer can build a prompt when the 'onupdate' event fires and/or can add appropriate field validation values to the application. However, these should be used in a manner to make sure the user experience is still appropriate. Ed Warren. "Chuck Hildebrandt" wrote in message m... I have Access 2003. It seems when I change a record, and go to close the sheet, there is no prompt asking me if I want to save the changes or cancel, which is certainly standard in Excel and Word. Is this by design? If so, is there any way to make it prompt? It seems it might be a problem if I change a record by mistake. Thanks. Chuck |
#5
|
|||
|
|||
Basic Tables Question
There is no need to go through all that work. All you need to do is
understand how to use the form's BeforeUpdate event properly to have COMPLETE control over whether or not a record gets saved. "Tom Lake" wrote in message ... "Chuck Hildebrandt" wrote in message m... I have Access 2003. It seems when I change a record, and go to close the sheet, there is no prompt asking me if I want to save the changes or cancel, which is certainly standard in Excel and Word. Is this by design? If so, is there any way to make it prompt? It seems it might be a problem if I change a record by mistake. That's the was Access is. What I do is to create a form used for Add mode only with all unbound fields then when an update button is pressed, I add the contents of the fields to the table. If the Cancel button is pressed no update occurs. It's more work but it is a lot safer. Tom Lake |
#6
|
|||
|
|||
Basic Tables Question
Of course you are correct, thanks
Ed Warren "Pat Hartman(MVP)" wrote in message ... That's the BeforeUpdate event, not onupdate. The BeforeUpdate event should be cancelled if any errors are detected or if you prompt the user and he says not to save. Use: Cancel = True to cancel the BeforeUpdate event. You can use .SetFocus to set focus back to a control that needs correcting and you can use MsgBox to display messages. For example: Private Sub Form_BeforeUpdate (Cancel As Integer) If IsNull(Me.SomeField) Then MsgBox "Some Field may not be null", vbOKOnly Cancel = True Me.SomeField.SetFocus End If If Me.SomeDate Date() + 7 Then MsgBox "Some Date must not be more than one week in the future", vbOKOnly Cancel = True Me.SomeDate.SetFocus End If End Sub "Ed Warren" wrote in message ... This is by design. As each record is edited it is posted back to the database. The developer can build a prompt when the 'onupdate' event fires and/or can add appropriate field validation values to the application. However, these should be used in a manner to make sure the user experience is still appropriate. Ed Warren. "Chuck Hildebrandt" wrote in message m... I have Access 2003. It seems when I change a record, and go to close the sheet, there is no prompt asking me if I want to save the changes or cancel, which is certainly standard in Excel and Word. Is this by design? If so, is there any way to make it prompt? It seems it might be a problem if I change a record by mistake. Thanks. Chuck |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
random sort my table | ADAM | Running & Setting Up Queries | 5 | December 30th, 2005 06:59 AM |
Basic Question for Lookups. | Bernard Piette | Database Design | 9 | December 19th, 2005 12:32 AM |
Basic Beginner Question: Reverse engineering A97 database | [email protected] | Visio | 1 | October 22nd, 2005 03:55 PM |
Question about compacting and linked tables | Chris Ennis | General Discussion | 1 | May 24th, 2005 03:15 PM |
Basic table structure question | Mattymoo | New Users | 6 | November 12th, 2004 01:47 PM |